diff --git a/manifests/config.pp b/manifests/config.pp index ee69acf6..ecd705dc 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -61,8 +61,8 @@ } exec { "change-selinux-status-to-${mode}": - command => "echo ${sestatus} > /${sx_fs_mount}/enforce", - unless => "grep -q '${sestatus}' /${sx_fs_mount}/enforce", + command => "echo ${sestatus} > /${::selinux::params::sx_fs_mount}/enforce", + unless => "grep -q '${sestatus}' /${::selinux::params::sx_fs_mount}/enforce", } } else { fail("Invalid mode specified for SELinux: ${mode}") diff --git a/manifests/init.pp b/manifests/init.pp index a7e16e93..ec1acdad 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -18,6 +18,7 @@ # class selinux ( $mode = $::selinux::params::mode, + $package_ensure = $::selinux::params::package_ensure, ) inherits selinux::params { include stdlib diff --git a/manifests/metadata.json b/manifests/metadata.json new file mode 100644 index 00000000..77f128c2 --- /dev/null +++ b/manifests/metadata.json @@ -0,0 +1,20 @@ +{ + "name": "jfryman/selinux", + "version": "0.1.1", + "author": "jfryman", + "summary": "This class manages SELinux on RHEL based systems", + "license": "Apache 2.0", + "source": "https://github.com/jfryman/puppet-selinux", + "project_page": "https://github.com/jfryman/puppet-selinux", + "issues_url": "https://github.com/jfryman/puppet-selinux/issues", + "dependencies": [ + { + "name": "puppetlabs-stdlib", + "version_range": ">= 4.0.0" + }, + { + "name": "puppetlabs-concat", + "version_range": ">= 1.0.0" + } + ] +} diff --git a/manifests/package.pp b/manifests/package.pp index bbbdb57d..93e8eead 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -19,12 +19,12 @@ case $::operatingsystemrelease { /^5.+$/: { package { 'policycoreutils': - ensure => present, + ensure => $selinux::params::package_ensure, } } /^(6|7).+$/: { package { 'policycoreutils-python': - ensure => present, + ensure => $selinux::params::package_ensure, } } default: { diff --git a/manifests/params.pp b/manifests/params.pp index fe320607..5a559255 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -9,6 +9,7 @@ class selinux::params { $sx_mod_dir = '/usr/share/selinux' $mode = 'disabled' + $package_ensure = present $sx_fs_mount = $::operatingsystem ? { /RedHat|CentOS/ => $::operatingsystemrelease ? {