Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Does file_line trigger a "subscribe" on the file?

$
0
0
Here is my class definition, in part: file { nrpecfg : ensure => file, path => "/etc/nagios/nrpe.cfg", } file_line { 'check_file_count_nrpe' : line => 'command[check_rsyslog_files]=sudo /usr/lib64/nagios/plugins/check_file_count', path => '/etc/nagios/nrpe.cfg', } exec { nrpereload : command => "/sbin/service nrpe reload", subscribe => File["/etc/nagios/nrpe.cfg"], refreshonly => true, } The "nrpereload" is not happening. It works fine when I take out the `subscribe` and `refreshonly` options -- that is, the exec works in general. But when I `subscribe` to the file, and then I change the file with `file_line`, it looks like the `subscribe` doesn't happen. It works this way: file_line { 'check_file_count_nrpe' : line => 'command[check_rsyslog_files]=sudo /usr/lib64/nagios/plugins/check_file_count ' , path => '/etc/nagios/nrpe.cfg', notify => Exec["nrpereload"], } exec { nrpereload : command => "/sbin/service nrpe reload", refreshonly => true, } but it makes more sense (to me) to tell the `exec` to watch the file, rather than to tell each individual file_line to `notify`. Anyway, is `subscribe` just not supported? Or did I do something wrong?

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>