I am currently working on implementing puppet in our environment, however, I have a request I dont know if puppet itself can fill.
If I have a configuration under /etc/myconfig.conf. And I want it to be written only if it doesnt already exist; I can use the onlyif function. But is there any way that I can get puppet to do something, a notify() or something if it detect a change in a file..?
I dont want it to actually change the file, only notify me that the file is not the way it want it to be..
There is really no examples or anything in this question, but I hope someone is able to push me in the right direction here. If I create a solution for this based on tips, I will post the answer myself for others to learn from.
Thanks
For only creating a file if it doesn’t exist, try setting replace to false, like so:
Docs for that are here: http://docs.puppetlabs.com/references/2.7.0/type.html#file
For the notification, puppet auditing will do what you need:
http://puppetlabs.com/blog/all-about-auditing-with-puppet/