Hello,
I have problem with my class when the archive is changed and the service is not restarted when i apply change and run the puppet agent, I have the next error:
[..............]
err: /Stage[main]/Spam_rule/Exec[zmamavisdctl]: Failed to call refresh: /opt/zimbra/bin/zmamavisdctl returned 1 instead of one of [0] at /etc/puppet/modules/spam_rule/manifests/init.pp:25
[..............]
Note: The change that i written in the archive (
/etc/puppet//modules/spam_rule/99_rules.cf) is applied to puppet agent the problem is only refresh (restart) to resource.
My class is "spam_rule" (/etc/puppet/modules/spam_rule/manifests/init.pp)
[..............]
class spam_rule {
if $TypeSrv == "zimbra" {
# global perms
File {
owner => zimbra,
group => zimbra,
mode => 644,
}
# create rule archive
file { "/opt/zimbra/conf/spamassassin/99_rule.cf": ensure => file,
# notify => Exec["zmamavisdctl"],
}
# define the service to restart
exec { "zmamavisdctl":
refreshonly => true,
command => "/opt/zimbra/bin/zmamavisdctl",
subscribe => File["/opt/zimbra/conf/spamassassin/99_rules.cf"], }
}
else{
# globals perms
File {
owner => mailcleaner,
group => mailcleaner,
mode => 644,
}
# create rules archive
file { "/usr/mailcleaner/share/spamassassin/99_rules.cf": ensure => file,
}
# service restart
exec { "mailscanner":
refreshonly => true,
command => "/usr/mailcleaner/etc/init.d/mailscanner",
subscribe => File["/usr/mailcleaner/share/spamassassin/99_rules.cf"], }
}
}
[..............]
My site.pp (/etc/puppet/manifests/)
[..............]
node /^mailcleaner.*$/ {
$TypeSrv="mailcleaner"
include spam_rule
}
$TypeSrv="zimbra"
include spam_rule
}
[..............]
¿Some suggestion?
Thanks