From e735829dfdf4457f55d63bdc30f3687f26c78723 Mon Sep 17 00:00:00 2001 From: Nic Waller Date: Sun, 6 Oct 2013 19:21:36 -0700 Subject: [PATCH] Cleanup some warnings from puppet-lint --- manifests/apache.pp | 16 +++++++++------- manifests/init.pp | 19 ++++++++++--------- manifests/params.pp | 4 ++-- manifests/postfix.pp | 8 ++++---- tests/init.pp | 12 ++++++------ 5 files changed, 31 insertions(+), 28 deletions(-) diff --git a/manifests/apache.pp b/manifests/apache.pp index c2c7992..75a3935 100644 --- a/manifests/apache.pp +++ b/manifests/apache.pp @@ -2,10 +2,10 @@ # # This is a helper class for Apache that provides a bare minimum configuration. # It is intended to help you get started quickly, but most people will probably -# outgrow this basic setup and need to configure Apache with a different module. +# outgrow this setup and need to configure Apache with a different module. # -# Apache is an important part of Mailman as it provides for web-based moderation, -# list management, and viewing of list archives. +# Apache is an important part of Mailman as it provides for web-based +# moderation, list management, and viewing of list archives. # # === Examples # @@ -44,7 +44,7 @@ serveradmin => "mailman@${mailman::smtp_hostname}", default_mods => true, default_vhost => false, - logroot => '/var/log/httpd', + logroot => '/var/log/httpd', } apache::listen { '80': } @@ -62,7 +62,6 @@ apache::vhost { $server_name: docroot => $document_root, - # TODO: doesn't apache module have these constants? docroot_owner => $http_username, docroot_group => $http_groupname, ssl => false, @@ -71,7 +70,10 @@ logroot => $log_dir, ip_based => true, # dedicate apache to mailman custom_fragment => $cf_all, - aliases => [ { alias => '/pipermail', path => $public_archive_dir } ], + aliases => [ { + alias => '/pipermail', + path => $public_archive_dir + } ], directories => [ { path => $mailman_cgi_dir, @@ -86,7 +88,7 @@ options => ['Indexes', 'MultiViews', 'FollowSymLinks'], order => 'Allow,Deny', custom_fragment => 'AddDefaultCharset Off' - } + } ], } diff --git a/manifests/init.pp b/manifests/init.pp index 57e3e5a..4dc3a81 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -47,7 +47,7 @@ # Mailman insists that the mail domain MUST have 2 or more parts. # # [*http_hostname*] -# This is the hostname that people use in a web browser to access the frontend. +# This is the hostname used in a web browser to access the frontend. # This commonly matches smtp_hostname but that isn't a requirement. # A single-label DNS name is permitted here (eg. "localhost"). # @@ -65,7 +65,8 @@ # have lists with a large number of invalid recipients in a single domain, # reducing this number is very likely to help with reliable delivery. # -# [*list_data_dir,log_dir,lock_dir,data_dir,pid_dir,spam_dir,queue_dir,archive_dir,pid_file*] +# [*list_data_dir, log_dir, lock_dir, data_dir, pid_dir, spam_dir, queue_dir +# archive_dir,pid_file*] # These parameters define where Mailman stores the data it creates. # Each of this must be overridden individually. # @@ -112,8 +113,8 @@ validate_bool($enable_service) validate_re($language, $langs) validate_re($mta, ['Manual', 'Postfix']) - validate_re($smtp_hostname, "^[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+$") - validate_re($http_hostname, "^[-a-zA-Z0-9\.]+$") + validate_re($smtp_hostname, '^[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+$') + validate_re($http_hostname, '^[-a-zA-Z0-9\.]+$') validate_bool($virtual_host_overview) validate_re($smtp_max_rcpts, '[0-9]*') @@ -122,7 +123,7 @@ # CAVEAT: On RHEL, rmlist requires var_prefix to match list_data_dir. $var_prefix = $mailman::params::var_prefix if ($::osfamily == 'RedHat') and ($list_data_dir != "${var_prefix}/lists") { - fail("On RHEL list_data_dir must be /lists, else rmlist will fail") + fail('rmlist requires that var_prefix is parent of list_data_dir on RHEL') } $mm_username = $mailman::params::mm_username @@ -153,7 +154,7 @@ if versioncmp($::mailmanversion, '2.1.15') > 0 { exec { 'genaliases': command => 'genaliases', - path => $bin_dir, + path => $mailman::params::bin_dir, refreshonly => true, subscribe => File['mm_cfg'], } @@ -202,7 +203,7 @@ } file { [$site_pw_file, $creator_pw_file]: ensure => present, - content => "$site_pw_hash\n", + content => "${site_pw_hash}\n", owner => 'root', group => $mm_groupname, mode => '0644', @@ -264,14 +265,14 @@ # password is immediately reset. exec { 'create_site_list': command => "newlist -q '${mailman_site_list}' '${admin_email}' 'CHANGEME'", - path => $bin_dir, + path => $mailman::params::bin_dir, creates => "${list_data_dir}/${mailman_site_list}/config.pck", require => [ File[$list_data_dir], File['mm_cfg'] ], notify => Exec['change_site_list_pw'], } exec { 'change_site_list_pw': command => "change_pw --quiet -l '${mailman_site_list}'", - path => $bin_dir, + path => $mailman::params::bin_dir, refreshonly => true, } diff --git a/manifests/params.pp b/manifests/params.pp index 79a1bb6..8956371 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -49,7 +49,7 @@ $wrapper_dir = "${exec_prefix}/mail" $bin_dir = "${prefix}/bin" $scripts_dir = "${prefix}/scripts" - if ($::operatingsystem == 'Fedora') and ($::operatingsystemmajrelease == 19) { + if ($::operatingsystem=='Fedora') and ($::operatingsystemmajrelease==19){ $template_dir = '/etc/mailman/templates' } else { $template_dir = "${prefix}/templates" @@ -92,7 +92,7 @@ $pid_file = "${pid_dir}/master-qrunner.pid" } default: { - fail("The ${module_name} module is not supported on an ${::osfamily} based system.") + fail("Mailman module is not supported on ${::osfamily}.") } } } diff --git a/manifests/postfix.pp b/manifests/postfix.pp index 0011848..7e1b4ae 100644 --- a/manifests/postfix.pp +++ b/manifests/postfix.pp @@ -2,13 +2,13 @@ # # This is a helper class for Postfix that provides a bare minimum configuration. # It is intended to help you get started quickly, but most people will probably -# outgrow this basic setup and need to configure Postfix with a different module. +# outgrow this setup and need to configure Postfix with a different module. # # Postfix is a critical part of Mailman as it enables messages to be sent and # received. # -# If you're seeing strange results for myhostname or mydomain, check your settings -# in /etc/resolv.conf, especially on RedHat systems. +# If you're seeing strange results for myhostname or mydomain, check your +# settings in /etc/resolv.conf, especially on RedHat systems. # # === Examples # @@ -25,7 +25,7 @@ class mailman::postfix { if $mailman::mta != 'Postfix' { - fail("Must set MTA=Postfix if using Postfix helper class") + fail('Must set MTA=Postfix if using Postfix helper class') } # TODO FIXME ensure this is not an open relay diff --git a/tests/init.pp b/tests/init.pp index b5837ec..72c3aa2 100644 --- a/tests/init.pp +++ b/tests/init.pp @@ -1,11 +1,11 @@ # The baseline for module testing used by Puppet Labs is that each manifest -# should have a corresponding test manifest that declares that class or defined -# type. +# should have a corresponding test manifest that declares that class or +# defined type. # -# Tests are then run by using puppet apply --noop (to check for compilation errors -# and view a log of events) or by fully applying the test in a virtual environment -# (to compare the resulting system state to the desired state). +# Tests are then run by using puppet apply --noop (to check for compilation +# errors and view a log of events) or by fully applying the test in a virtual +# environment (to compare the resulting system state to the desired state). # -# Learn more about module testing here: http://docs.puppetlabs.com/guides/tests_smoke.html +# More about module testing: http://docs.puppetlabs.com/guides/tests_smoke.html # include mailman