I have the following classes:
class zabbix-agent {
...
package {'zabbix-agent':
ensure => installed
}
...
service { "zabbix-agent":
ensure => running,
start => "/etc/init.d/zabbix-agent start",
stop => "/etc/init.d/zabbix-agent stop",
status => "/etc/init.d/zabbix-agent status",
restart => "/etc/init.d/zabbix-agent restart",
require => Package['zabbix-agent']
}
}
class redis {
...
file {"/etc/zabbix/zabbix_agentd.conf.d/redis.conf":
source => "puppet:///modules/redis/redis_monitoring.conf",
require => Package['zabbix-agent'],
notify => Service['zabbix-agent']
}
...
}
node /^data\d+\.example\.com$/ inherits 'prerun'
{
class 'redis'
}
node 'prerun' {
...
class {'zabbix-agent': stage => pre}
...
}
but that code produces error:
err: Could not apply complete catalog: Found dependency cycles in the following relationships: Service[zabbix-agent] => File[/etc/redis/redis.conf], Package[redis-server] => File[/etc/redis/redis.conf], Service[zabbix-agent] => Class[Settings], Service[zabbix-agent] => File[/etc/puppet/puppet.conf], File[/etc/zabbix/zabbix_agentd.conf.d/redis_monitoring.conf] => Service[zabbix-agent], Service[zabbix-agent] => File[/etc/zabbix/zabbix_agentd.conf.d/redis_monitoring.conf], Service[zabbix-agent] => File[/etc/puppet/auth.conf], Service[zabbix-agent] => Class[prerun], File[/etc/redis/redis.conf] => Service[redis-server], Service[zabbix-agent] => Service[redis-server], Service[zabbix-agent] => Package[redis-server], Service[zabbix-agent] => File[/etc/puppet/namespaceauth.conf], Service[zabbix-agent] => Class[
datad.leaderboard.lvis.tv]; try using the '--graph' option and open the '.dot' files in OmniGraffle or GraphViz
what's wrong? if I comment out 'notify' puppet doesn't complain, but doesn't restart service too.