file { "/etc/nsswitch.conf": mode => 644, source => "puppet://server.example.com/etc/nsswitch.conf" } service { nscd: ensure => true, enable => true, hasrestart => true, subscribe => File['/etc/nsswitch.conf'] } service { messagebus: ensure => true, enable => true, hasrestart => true, subscribe => File['/etc/nsswitch.conf'] }
restarting a service when a file is changed (subscribe)