My tradition is to set all zone serials to the timestamp at modification. Now that Puppet is my new religion, I want to set serial timestamps when building zone files from exported resources. A somewhat trivialized example may look like this:
file { "/tmp/dafile": content = inline_template("<%= Time.now.to_i %>"), }
The problem with this approach is that content will be different all the time, which will (ultimately) provoke rebuilding of zone files on each puppet config poll.
Is there some way I can insert a timestamp without it being included in the data that is compared against previous state?
Best Answer
Don't use a template, if you try to use a serial number there the problem is your going to keep making changes each time.
I have two ideas:
Some examples of the file fragment pattern are here:
http://projects.puppetlabs.com/projects/puppet/wiki/Generating_a_config_file_from_fragments
https://github.com/ripienaar/puppet-concat