Showing with 35 additions and 16 deletions.
  1. +6 −5 manifests/config.pp
  2. +7 −7 manifests/module.pp
  3. +3 −3 manifests/restorecond/config.pp
  4. +19 −1 metadata.json
11 changes: 6 additions & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@
# RHEL <= 5 do not support --follow-symlinks with sed
# ref: @lboynton: http://git.io/QvJ9ww
/^5/: {
$selinux_set_command = "sed -i \"s@^\\(SELINUX=\\).*@\\1${mode}@\" /etc/sysconfig/selinux"
$selinux_set_command = "sed -i \"s@^\\(SELINUX=\\).*@\\1${mode}@\" /etc/selinux/config"
}
default: {
$selinux_set_command = "sed -i --follow-symlinks \"s@^\\(SELINUX=\\).*@\\1${mode}@\" /etc/sysconfig/selinux"
$selinux_set_command = "sed -i --follow-symlinks \"s@^\\(SELINUX=\\).*@\\1${mode}@\" /etc/selinux/config"
}
}

exec { "set-selinux-config-to-${mode}":
command => $selinux_set_command,
unless => "grep -q \"SELINUX=${mode}\" /etc/sysconfig/selinux",
unless => "grep -q \"SELINUX=${mode}\" /etc/selinux/config",
}

case $mode {
Expand All @@ -61,8 +61,9 @@
}

exec { "change-selinux-status-to-${mode}":
command => "echo ${sestatus} > /${::selinux::params::sx_fs_mount}/enforce",
unless => "grep -q '${sestatus}' /${::selinux::params::sx_fs_mount}/enforce",
command => "setenforce ${sestatus}",
unless => "getenforce | grep -qi ${mode}",
path => '/bin:/usr/bin:/usr/sbin',
}
} else {
fail("Invalid mode specified for SELinux: ${mode}")
Expand Down
14 changes: 7 additions & 7 deletions manifests/module.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@
}

exec { "${name}-checkloaded":
refreshonly => false,
creates => "/etc/selinux/${::selinux_config_policy}/modules/active/modules/${name}.pp",
command => 'true',
notify => Exec["${name}-buildmod"],
refreshonly => false,
creates => "/etc/selinux/${::selinux_config_policy}/modules/active/modules/${name}.pp",
command => 'true',
notify => Exec["${name}-buildmod"],
}

## Begin Configuration
file { "${::selinux::params::sx_mod_dir}/${name}.te":
ensure => $ensure,
source => $source,
tag => 'selinux-module',
ensure => $ensure,
source => $source,
tag => 'selinux-module',
}
if !$use_makefile {
file { "${::selinux::params::sx_mod_dir}/${name}.mod":
Expand Down
6 changes: 3 additions & 3 deletions manifests/restorecond/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
}

concat::fragment {'restorecond_config_default':
target => $selinux::restorecond::config_file,
source => 'puppet:///modules/selinux/restorecond.conf',
order => '05'
target => $selinux::restorecond::config_file,
source => 'puppet:///modules/selinux/restorecond.conf',
order => '05'
}
}
20 changes: 19 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
{
"name": "jfryman/selinux",
"version": "0.2.0",
"version": "0.2.2",
"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",
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "Fedora",
"operatingsystemrelease": [
"19",
"20",
"21"
]
}
],
"dependencies": [
{
"name": "puppetlabs/stdlib",
Expand Down