2017-07-20 12:38:15 +01:00
|
|
|
## cd_selinux::params.pp
|
|
|
|
|
# Module name: cd_selinux
|
|
|
|
|
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
|
|
|
|
|
# @summary Class holds all parameters for the cd_selinux module and is
|
|
|
|
|
# inherited by all classes except defines.
|
2025-05-14 13:34:43 +02:00
|
|
|
# @param [String] 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`.
|
2025-05-14 13:34:43 +02:00
|
|
|
# @param [Boolean] sx_install_setools Whether to install additional selinux
|
2017-07-20 12:38:15 +01:00
|
|
|
# tools, i.e. for troubleshooting.
|
2025-05-14 13:34:43 +02:00
|
|
|
# @param [String] sx_selinux_status The desired selinux status. Used for both
|
2017-08-03 12:36:11 +01:00
|
|
|
# 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`
|
2025-05-14 13:34:43 +02:00
|
|
|
# to any the other types requires a manual reboot to re-label the file system.
|
2017-08-03 12:36:11 +01:00
|
|
|
# This module does not do that for you to avoid unexpected outages.
|
2025-05-14 13:34:43 +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
|
|
|
##############################################################################
|
|
|
|
|
class cd_selinux::params (
|
|
|
|
|
|
2025-05-14 13:34:43 +02:00
|
|
|
String $pkg_ensure = 'latest',
|
2017-07-20 12:38:15 +01:00
|
|
|
|
2025-05-14 13:34:43 +02:00
|
|
|
Boolean $sx_install_setools = false,
|
|
|
|
|
String $sx_selinux_status = 'enforcing',
|
|
|
|
|
String $sx_selinux_type = 'targeted',
|
2017-07-20 12:38:15 +01:00
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
# installation section
|
2025-05-14 13:34:43 +02:00
|
|
|
$reqpackages_main = $::operatingsystem ? {
|
2017-07-20 12:38:15 +01:00
|
|
|
/(?i-mx:centos|fedora|redhat)/ => ['selinux-policy','policycoreutils'],
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-14 13:34:43 +02:00
|
|
|
$reqpackages_tools = $::operatingsystem ? {
|
|
|
|
|
/(?i-mx:centos|fedora|redhat)/ => ['setroubleshoot-server','policycoreutils-python'],
|
2017-07-20 12:38:15 +01:00
|
|
|
}
|
|
|
|
|
|
2017-07-20 12:49:07 +01:00
|
|
|
# directories
|
2025-05-14 13:34:43 +02:00
|
|
|
$sx_main_dir = '/etc/selinux'
|
2017-07-20 13:07:11 +01:00
|
|
|
|
|
|
|
|
# files
|
2025-05-14 13:34:43 +02:00
|
|
|
$sx_main_file = "${sx_main_dir}/config"
|
|
|
|
|
$sx_main_file_erb = 'cd_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
|
|
|
|
|
include cd_selinux::main::config
|
|
|
|
|
}
|