debian's service provider has some issues if the script is absent, we can workaround this problem using the trick of this patch

This commit is contained in:
mh 2013-05-20 18:54:13 +02:00
parent 8e43dc85da
commit 39f1218960
3 changed files with 23 additions and 9 deletions

View file

@ -1,12 +1,7 @@
# remove postfix
class postfix::disable {
service{'postfix':
ensure => stopped,
enable => false,
case $::operatingsystem {
debian: { include postfix::disable::debian }
default: { include postfix::disable::base }
}
package{'postfix':
ensure => absent,
require => Service['postfix'],
}
}

12
manifests/disable/base.pp Normal file
View file

@ -0,0 +1,12 @@
class postfix::disable::base {
service{'postfix':
ensure => stopped,
enable => false,
}
package{'postfix':
ensure => absent,
require => Service['postfix'],
}
}

View file

@ -0,0 +1,7 @@
# debian has some issues with absent
# init scripts
class postfix::disable::debian inherits postfix::disable::base {
Service['postfix']{
hasstatus => false,
}
}