Hi,
I'm fairly new to puppet and am working my way through various approaches to problems - probably doing them in all the worst possible ways...
One thing I'm currently trying to do is configure an application using heira and puppet. The application comes with a selection of default template configuration files which I'm using Augeas in Puppet to configure with the valies from heira as required.
Essentially my class is doing the following:
file{'config.file':
source=> "file://src/template.xml",
path => "$destfolder/template.xml"
} ->
augeas {"config.file_aug":
lens => "xml.lns",
incl => "$destfolder/template.xml",
changes => [ "setm... "]
}
Now, this is working... but what of course what's happening is that every time puppet runs, the first file resource replaces the template.xml with the original copy, then the augeas re-edits it to match the file that was just replaced.
I could make sure the file resource doesn't replace the new one with 'replace -> false', but then if unwanted changes occur, we'd never know.
How can I combine a the required augeas changes to the xml template file before it's checked?
Should I use puppet to construct the new version in a temporary folder, and the do a final file resource to compare the constructed version with the live version?
Thanks in advance,
Dave