Created
May 19, 2012 04:15
-
-
Save reidmv/2729059 to your computer and use it in GitHub Desktop.
Trigger an exec upon changes to a semi-managed file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$subject = '/etc/sysconfig/authconfig' | |
$monitor = '/var/tmp/authconfig_monitor' | |
file { $subject: | |
ensure => file, | |
} | |
exec { "trigger on update to $subject": | |
provider => shell, | |
command => "date > $monitor && /bin/dostuff", | |
onlyif => "[ ! -e $monitor -o $subject -nt $monitor ]", | |
require => File[$subject], | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment