Files
confdroid_selinux/manifests/params.pp

48 lines
2.2 KiB
ObjectPascal
Raw Normal View History

2026-04-05 16:45:14 +02:00
## confdroid_selinux::params.pp
# Module name: confdroid_selinux
# Author: 12ww1160 (12ww1160@ConfDroid.com)
# @summary Class holds all parameters for the confdroid_selinux module and is
2017-07-20 12:38:15 +01:00
# inherited by all classes except defines.
2026-04-05 16:45:14 +02:00
# @param [String] sx_pkg_ensure
2017-07-20 12:38:15 +01:00
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
# to choose, i.e. `latest` or `present`.
2026-04-05 16:45:14 +02:00
# @param [Array[String]] sx_reqpackages
# List of packages required for selinux management. The default list includes
# the following packages: `selinux-policy`, `policycoreutils`,
# `setroubleshoot-server`, `policycoreutils-python`.
# @param [String] sx_selinux_status The desired selinux status. Used for both
# managing the configuration file as well as the command line (setenforce).
# Valid values are `enforcing` and `permissive`. While the configuration file
# supports another option 'disabled', this option is not available on
# commandline. Note that changing the active selinux status from `disabled`
# to any the other types requires a manual reboot to re-label the file system.
# This module does not do that for you to avoid unexpected outages.
2026-04-05 16:45:14 +02:00
# @param [String] sx_selinux_type The desired selinux type. Valid options are
2017-07-20 13:07:11 +01:00
# `targeted`, `minimum` and `mls`.
2017-07-20 12:38:15 +01:00
##############################################################################
2026-04-05 16:45:14 +02:00
class confdroid_selinux::params (
2017-07-20 12:38:15 +01:00
2026-04-05 16:45:14 +02:00
Array[String] $sx_reqpackages = ['selinux-policy','policycoreutils','setroubleshoot-server','policycoreutils-python'],
String $sx_pkg_ensure = 'latest',
String $sx_selinux_status = 'enforcing',
String $sx_selinux_type = 'targeted',
2017-07-20 12:38:15 +01:00
) {
2026-04-05 16:45:14 +02:00
# default facts
$fqdn = $facts['networking']['fqdn']
$hostname = $facts['networking']['hostname']
$domain = $facts['networking']['domain']
$os_name = $facts['os']['name']
$os_release = $facts['os']['release']['major']
2017-07-20 12:38:15 +01:00
2017-07-20 12:49:07 +01:00
# directories
$sx_main_dir = '/etc/selinux'
2017-07-20 13:07:11 +01:00
# files
$sx_main_file = "${sx_main_dir}/config"
2026-04-05 16:45:14 +02:00
$sx_main_file_erb = 'confdroid_selinux/main/selinux_config.erb'
2017-07-20 12:49:07 +01:00
2017-07-20 12:38:15 +01:00
# includes must be last
2026-04-05 16:45:14 +02:00
include confdroid_selinux::main::config
2017-07-20 12:38:15 +01:00
}