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
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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.  
+4 −0
Original line number Diff line number Diff line
@@ -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)
+2 −0
Original line number Diff line number Diff line
@@ -5,8 +5,10 @@ class postfix::packages {
    ensure => $postfix::postfix_ensure,
  }

  if ($postfix::manage_mailx) {
    package { 'mailx':
      ensure => $postfix::mailx_ensure,
      name   => $postfix::params::mailx_package,
    }
  }
}
+6 −0
Original line number Diff line number Diff line
@@ -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