Commit 4c9d6925 authored by Will Yardley's avatar Will Yardley Committed by Raphaël Pinson
Browse files

Add $manage_mailx boolean to control whether mailx is managed (#143)

* Add $manage_mailx boolean to control whether mailx is managed (replacement for PR #141)

* add more docs for $manage_mailx

* fix scope of variable
parent 6d7d042a
......@@ -105,6 +105,12 @@ A Boolean defining whether the puppet module should replace the configuration fi
Default: true.
##### `manage_mailx`
A Boolean defining whether the puppet module should manage the mailx package. See also $mailx_ensure.
Default: true.
##### `mastercf_source`
A string defining the location of a skeleton master.cf file to be used.
Default: Undefined.
......
......@@ -26,6 +26,8 @@
#
# [*manage_conffiles*] - (boolean) Whether config files are to be replaced
#
# [*manage_mailx*] - (boolean) Whether to manage mailx package.
#
# [*mastercf_source*] - (string)
#
# [*master_smtp*] - (string)
......@@ -80,6 +82,7 @@ class postfix (
$mailman = false,
$maincf_source = "puppet:///modules/${module_name}/main.cf",
$manage_conffiles = true,
$manage_mailx = true,
$mastercf_source = undef,
$master_smtp = undef, # postfix_master_smtp
$master_smtps = undef, # postfix_master_smtps
......@@ -106,6 +109,7 @@ class postfix (
validate_bool($mailman)
validate_bool($mta)
validate_bool($manage_root_alias)
validate_bool($manage_mailx)
validate_bool($satellite)
validate_bool($use_amavisd)
validate_bool($use_dovecot_lda)
......
......@@ -5,8 +5,10 @@ class postfix::packages {
ensure => $postfix::postfix_ensure,
}
package { 'mailx':
ensure => $postfix::mailx_ensure,
name => $postfix::params::mailx_package,
if ($postfix::manage_mailx) {
package { 'mailx':
ensure => $postfix::mailx_ensure,
name => $postfix::params::mailx_package,
}
}
}
......@@ -295,6 +295,12 @@ describe 'postfix' do
is_expected.not_to contain_mailalias('root')
end
end
context 'when manage_mailx is false' do
let(:params) { { :manage_mailx => false } }
it 'should not have mailx package' do
is_expected.not_to contain_package('mailx')
end
end
end
end
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment