From e4e57b05ad12cfa43e7d644ce97390ce32f296fd Mon Sep 17 00:00:00 2001 From: Eric Shamow Date: Mon, 17 Sep 2012 01:08:42 -0400 Subject: [PATCH] Cleaned up lint errors. 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. --- manifests/config.pp | 7 +++++-- manifests/init.pp | 4 ++-- manifests/module.pp | 16 ++++++++-------- manifests/params.pp | 8 ++++++++ tests/disable.pp | 4 ++-- tests/enable.pp | 6 +++--- tests/module.pp | 4 ++-- 7 files changed, 30 insertions(+), 19 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index d18afe46..fd6bd280 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -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) # @@ -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') @@ -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}": diff --git a/manifests/init.pp b/manifests/init.pp index a06d7ba0..35407767 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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] @@ -24,7 +24,7 @@ anchor { 'selinux::begin': } -> class { 'selinux::config': - mode => $mode, + mode => $mode, } -> anchor { 'selinux::end': } } diff --git a/manifests/module.pp b/manifests/module.pp index a18005fc..634a509d 100644 --- a/manifests/module.pp +++ b/manifests/module.pp @@ -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: @@ -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 { @@ -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 diff --git a/manifests/params.pp b/manifests/params.pp index 7b862a7b..5f8a869f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' } diff --git a/tests/disable.pp b/tests/disable.pp index a09ad00c..8fd261f3 100644 --- a/tests/disable.pp +++ b/tests/disable.pp @@ -1,9 +1,9 @@ -# Class: +# Class: # # Description # # Parameters: -# +# # Actions: # # Requires: diff --git a/tests/enable.pp b/tests/enable.pp index ef4ab9a0..8f585356 100644 --- a/tests/enable.pp +++ b/tests/enable.pp @@ -1,9 +1,9 @@ -# Class: +# Class: # # Description # # Parameters: -# +# # Actions: # # Requires: @@ -11,6 +11,6 @@ # Sample Usage: # -class { 'selinux': +class { 'selinux': mode => 'enforcing', } diff --git a/tests/module.pp b/tests/module.pp index d266aeb5..5c5439da 100644 --- a/tests/module.pp +++ b/tests/module.pp @@ -1,9 +1,9 @@ -# Class: +# Class: # # Description # # Parameters: -# +# # Actions: # # Requires: