Commit be33e7ef authored by Mickaël Canévet's avatar Mickaël Canévet
Browse files

Merge pull request #78 from smithtrevor/systemd_restart_support

Systemd restart support
parents 32ebb5d2 cd2a6f8d
...@@ -7,6 +7,11 @@ class postfix::params { ...@@ -7,6 +7,11 @@ class postfix::params {
default => undef, default => undef,
} }
$restart_cmd = $::operatingsystemmajrelease ? {
'7' => '/bin/systemctl reload postfix',
default => '/etc/init.d/postfix reload',
}
$mailx_package = 'mailx' $mailx_package = 'mailx'
$master_os_template = "${module_name}/master.cf.redhat.erb" $master_os_template = "${module_name}/master.cf.redhat.erb"
...@@ -15,6 +20,8 @@ class postfix::params { ...@@ -15,6 +20,8 @@ class postfix::params {
'Debian': { 'Debian': {
$seltype = undef $seltype = undef
$restart_cmd = '/etc/init.d/postfix reload'
$mailx_package = $::lsbdistcodename ? { $mailx_package = $::lsbdistcodename ? {
/sarge|etch|lenny/ => 'mailx', /sarge|etch|lenny/ => 'mailx',
default => 'bsd-mailx', default => 'bsd-mailx',
...@@ -26,6 +33,8 @@ class postfix::params { ...@@ -26,6 +33,8 @@ class postfix::params {
'Suse': { 'Suse': {
$seltype = undef $seltype = undef
$restart_cmd = '/etc/init.d/postfix reload'
$mailx_package = 'mailx' $mailx_package = 'mailx'
if $::operatingsystem != 'SLES' { if $::operatingsystem != 'SLES' {
......
...@@ -3,6 +3,6 @@ class postfix::service { ...@@ -3,6 +3,6 @@ class postfix::service {
ensure => running, ensure => running,
enable => true, enable => true,
hasstatus => true, hasstatus => true,
restart => '/etc/init.d/postfix reload', restart => $::postfix::params::restart_cmd,
} }
} }
...@@ -67,7 +67,7 @@ describe 'postfix' do ...@@ -67,7 +67,7 @@ describe 'postfix' do
:ensure => 'running', :ensure => 'running',
:enable => 'true', :enable => 'true',
:hasstatus => 'true', :hasstatus => 'true',
:restart => '/etc/init.d/postfix reload' :restart => '/bin/systemctl reload postfix'
) } ) }
end end
end end
......
Supports Markdown
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