From c760c9cc29afc2fb5f466fba7047e43c9dd0ef88 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 30 Dec 2017 13:33:42 -0200 Subject: Avoid undefined variable warnings --- manifests/init.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index d298183..3637cdd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -77,10 +77,12 @@ class postfix( 'Debian': { $master_cf_template = "postfix/master.cf.debian-${::operatingsystemmajrelease}.erb" + $postfix_seltype = undef } 'Ubuntu': { $master_cf_template = 'postfix/master.cf.debian-sid.erb' + $postfix_seltype = undef } default: { @@ -99,7 +101,7 @@ class postfix( include postfix::anonsasl } # this global variable needs to get parameterized as well - if $::header_checks == 'yes' { + if $manage_header_checks == 'yes' { include postfix::header_checks } if $manage_tls_policy == 'yes' { -- cgit v1.2.3 From e530e301aeb77194b4aebf40c2d4380d79fb96c8 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 30 Dec 2017 13:59:46 -0200 Subject: Check if mailx package is not already defined by other modules --- manifests/init.pp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'manifests/init.pp') diff --git a/manifests/init.pp b/manifests/init.pp index 3637cdd..8ee2346 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -119,12 +119,18 @@ class postfix( include postfix::virtual_regexp } - package { ['postfix', 'mailx']: - ensure => installed + package { 'postfix': + ensure => installed, } - if $::operatingsystem == 'debian' { - Package[mailx] { name => 'bsd-mailx' } + if !defined(Package['mailx']) { + package { 'mailx': + ensure => installed, + name => $::operatingsystem ? { + debian => 'bsd-mailx', + default => 'mailx', + }, + } } service { 'postfix': -- cgit v1.2.3