I am using an exec command to run a shell script which modifies certain configuration files of other packages. The exec command is triggered whenever input parameters such as ip addresses, ports or url change, or when the shell script itself has been changed.
I have to use a shell script because the configuration files of the software package differ slightly between releases. I think it is easier to update the configuration file per sed script instead of providing different puppet templates for each particular release.
But this configuration does not detect when any of the configuration files have been modified outside of puppet. Puppet does not know about the files which are been modified by the shell script.
What I am looking for is a way to make the exec command dependend on the checksums of arbitrary other files:
exec { "my_command.sh":
only_if_file_has_changed => [
"/etc/mysoftware/config.xml",
"/etc/othersoftware/defaults",
]
}
Is this possible? Please advise.