Skip to content

Commit

Permalink
Cleanup some warnings from puppet-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Nic Waller committed Oct 7, 2013
1 parent 5b1dbaa commit e735829
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
16 changes: 9 additions & 7 deletions manifests/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down Expand Up @@ -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': }

Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -86,7 +88,7 @@
options => ['Indexes', 'MultiViews', 'FollowSymLinks'],
order => 'Allow,Deny',
custom_fragment => 'AddDefaultCharset Off'
}
}
],
}

Expand Down
19 changes: 10 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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").
#
Expand All @@ -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.
#
Expand Down Expand Up @@ -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]*')

Expand All @@ -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 <VAR_PREFIX>/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
Expand Down Expand Up @@ -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'],
}
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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,
}

Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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}.")
}
}
}
8 changes: 4 additions & 4 deletions manifests/postfix.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/init.pp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e735829

Please sign in to comment.