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:
parent
8e43dc85da
commit
39f1218960
3 changed files with 23 additions and 9 deletions
|
@ -1,12 +1,7 @@
|
||||||
|
# remove postfix
|
||||||
class postfix::disable {
|
class postfix::disable {
|
||||||
|
case $::operatingsystem {
|
||||||
service{'postfix':
|
debian: { include postfix::disable::debian }
|
||||||
ensure => stopped,
|
default: { include postfix::disable::base }
|
||||||
enable => false,
|
|
||||||
}
|
}
|
||||||
package{'postfix':
|
|
||||||
ensure => absent,
|
|
||||||
require => Service['postfix'],
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
12
manifests/disable/base.pp
Normal file
12
manifests/disable/base.pp
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
class postfix::disable::base {
|
||||||
|
|
||||||
|
service{'postfix':
|
||||||
|
ensure => stopped,
|
||||||
|
enable => false,
|
||||||
|
}
|
||||||
|
package{'postfix':
|
||||||
|
ensure => absent,
|
||||||
|
require => Service['postfix'],
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
7
manifests/disable/debian.pp
Normal file
7
manifests/disable/debian.pp
Normal 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,
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue