Denis Kot
2014-Jan-13 13:51 UTC
[Puppet Users] Notify service in one class from other class
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. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d29df46d-8802-4c6f-9c02-1be1d7660918%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.