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 ...@@ -105,6 +105,12 @@ A Boolean defining whether the puppet module should replace the configuration fi
Default: true. Default: true.
##### `manage_mailx`
A Boolean defining whether the puppet module should manage the mailx package. See also $mailx_ensure.
Default: true.
##### `mastercf_source` ##### `mastercf_source`
A string defining the location of a skeleton master.cf file to be used. A string defining the location of a skeleton master.cf file to be used.
Default: Undefined. Default: Undefined.
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
# #
# [*manage_conffiles*] - (boolean) Whether config files are to be replaced # [*manage_conffiles*] - (boolean) Whether config files are to be replaced
# #
# [*manage_mailx*] - (boolean) Whether to manage mailx package.
#
# [*mastercf_source*] - (string) # [*mastercf_source*] - (string)
# #
# [*master_smtp*] - (string) # [*master_smtp*] - (string)
...@@ -80,6 +82,7 @@ class postfix ( ...@@ -80,6 +82,7 @@ class postfix (
$mailman = false, $mailman = false,
$maincf_source = "puppet:///modules/${module_name}/main.cf", $maincf_source = "puppet:///modules/${module_name}/main.cf",
$manage_conffiles = true, $manage_conffiles = true,
$manage_mailx = true,
$mastercf_source = undef, $mastercf_source = undef,
$master_smtp = undef, # postfix_master_smtp $master_smtp = undef, # postfix_master_smtp
$master_smtps = undef, # postfix_master_smtps $master_smtps = undef, # postfix_master_smtps
...@@ -106,6 +109,7 @@ class postfix ( ...@@ -106,6 +109,7 @@ class postfix (
validate_bool($mailman) validate_bool($mailman)
validate_bool($mta) validate_bool($mta)
validate_bool($manage_root_alias) validate_bool($manage_root_alias)
validate_bool($manage_mailx)
validate_bool($satellite) validate_bool($satellite)
validate_bool($use_amavisd) validate_bool($use_amavisd)
validate_bool($use_dovecot_lda) validate_bool($use_dovecot_lda)
......
...@@ -5,8 +5,10 @@ class postfix::packages { ...@@ -5,8 +5,10 @@ class postfix::packages {
ensure => $postfix::postfix_ensure, ensure => $postfix::postfix_ensure,
} }
package { 'mailx': if ($postfix::manage_mailx) {
ensure => $postfix::mailx_ensure, package { 'mailx':
name => $postfix::params::mailx_package, ensure => $postfix::mailx_ensure,
name => $postfix::params::mailx_package,
}
} }
} }
...@@ -295,6 +295,12 @@ describe 'postfix' do ...@@ -295,6 +295,12 @@ describe 'postfix' do
is_expected.not_to contain_mailalias('root') is_expected.not_to contain_mailalias('root')
end end
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 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