I'm using puppet and augeas tool quite a lot to configure property files. My latest requirement is to apply the same fixed set of changes to quite a long list of property files. So, I would like to do it in one run, and not to write an augeas for each property file.
Example:
augeas { 'change_name_whatever':
lens => 'a_customized_lens',
incl => "$path/file1.properties",
changes => $change_set,
}
augeas { 'change_name_whatever':
lens => 'a_customized_lens',
incl => "$path/file2.properties",
changes => $change_set,
}
etc...
I would like to use:
augeas { 'change_name_whatever':
lens => 'a_customized_lens',
incl => "[list of files to change],
changes => $change_set,
}
but it's not possible since augeas needs to pre-load the file.
Since I am using puppet 3.8, I can't use foreach type of looping. I saw that in puppet 4 you can declare a list of files, and then loop on them and do your thing. Which is cool... but doesn't work in puppet 3.
So, do I have any other solution then copy/pasting the same code many times?
cheers.