Skip to content

Commit

Permalink
Cleaned up lint errors.
Browse files Browse the repository at this point in the history
Small fixes, mostly removing padding.  Linter was run with 80 char line limit
disabled as there is currently debate as to the necessity of this limit.
  • Loading branch information
Eric Shamow committed Sep 17, 2012
1 parent 40ef42d commit e4e57b0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 19 deletions.
7 changes: 5 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# Parameters:
# - $mode (enforced|permissive|disabled) - sets the operating state for SELinux.
#
#
# Actions:
# Configures SELinux to a specific state (enforced|permissive|disabled)
#
Expand Down Expand Up @@ -34,7 +34,7 @@
}

case $mode {
permissive,disabled: {
permissive,disabled: {
$sestatus = '0'
if $mode == 'disabled' and $::selinux_current_mode == 'permissive' {
notice('A reboot is required to fully disable SELinux. SELinux will operate in Permissive mode until a reboot')
Expand All @@ -43,6 +43,9 @@
enforcing: {
$sestatus = '1'
}
default : {
fail('You must specify a mode (enforced, permissive, or disabled) for selinux operation')
}
}

exec { "change-selinux-status-to-${mode}":
Expand Down
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#
# Actions:
# This module will configure SELinux and/or deploy SELinux based modules to running
# system.
# system.
#
# Requires:
# - Class[stdlib]. This is Puppet Labs standard library to include additional methods for use within Puppet. [https://github.com/puppetlabs/puppetlabs-stdlib]
Expand All @@ -24,7 +24,7 @@

anchor { 'selinux::begin': }
-> class { 'selinux::config':
mode => $mode,
mode => $mode,
}
-> anchor { 'selinux::end': }
}
16 changes: 8 additions & 8 deletions manifests/module.pp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Definition: selinux::module
#
# Description
# This class will either install or uninstall a SELinux module from a running system.
# This module allows an admin to keep .te files in text form in a repository, while
# allowing the system to compile and manage SELinux modules.
# This class will either install or uninstall a SELinux module from a running system.
# This module allows an admin to keep .te files in text form in a repository, while
# allowing the system to compile and manage SELinux modules.
#
# Concepts incorporated from:
# Concepts incorporated from:
# http://stuckinadoloop.wordpress.com/2011/06/15/puppet-managed-deployment-of-selinux-modules/
#
# Parameters:
Expand All @@ -23,12 +23,12 @@
# Sample Usage:
# selinux::module{ 'apache':
# ensure => 'present',
# source => 'puppet:///modules/selinux/apache.te',
# source => 'puppet:///modules/selinux/apache.te',
# }
#
define selinux::module(
$source,
$ensure = 'present',
$source
) {
# Set Resource Defaults
File {
Expand All @@ -40,8 +40,8 @@
# Only allow refresh in the event that the initial .te file is updated.
Exec {
path => '/sbin:/usr/sbin:/bin:/usr/bin',
refreshonly => 'true',
cwd => "${selinux::params::sx_mod_dir}",
refreshonly => true,
cwd => $selinux::params::sx_mod_dir,
}

## Begin Configuration
Expand Down
8 changes: 8 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Class: selinux::params
#
# Description
# This class provides default parameters for the selinux class
#
# Sample Usage:
# mod_dir = $selinux::params::sx_mod_dir
#
class selinux::params {
$sx_mod_dir = '/usr/share/selinux'
}
4 changes: 2 additions & 2 deletions tests/disable.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Class:
# Class:
#
# Description
#
# Parameters:
#
#
# Actions:
#
# Requires:
Expand Down
6 changes: 3 additions & 3 deletions tests/enable.pp
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Class:
# Class:
#
# Description
#
# Parameters:
#
#
# Actions:
#
# Requires:
#
# Sample Usage:
#

class { 'selinux':
class { 'selinux':
mode => 'enforcing',
}
4 changes: 2 additions & 2 deletions tests/module.pp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Class:
# Class:
#
# Description
#
# Parameters:
#
#
# Actions:
#
# Requires:
Expand Down

0 comments on commit e4e57b0

Please sign in to comment.