Re: [Puppet Users] Update time in template file.

Daniel Pittman
2010-12-19T22:37:04Z

On Mon, Dec 20, 2010 at 08:16, rjl <rjlindal@gmail.com> wrote:

> How can I put in an update time in a template file? The problem I am
> running it to is this...  Here is my file to update the timestamp

[...]

> The problem is that everytime puppet runs, it updates the time stamp.
> I only want it to update if there was an actual change to the content
> of the file

It would: there is no way for puppet to know that the changed content
of the template header is "unimportant", compared to other changes.
(Given this is an ERB template, there is no possible way to ever
determine that, unfortunately, and we can''t hook template generation
well enough either.)

Your only solution would be to use some detail that did not ever
change: personally, I used the "Time Stamp" feature that Emacs offers
to statically update the timestamp when the file was saved, rather
than puppet.

If you wanted something more automatic I would probably look to VCS
keyword expansion, or to using the mtime of the template on the server
as the date, rather than the time that puppet expanded it.

Regards,
    Daniel
--
✣ Daniel Pittman            ✉ daniel@rimspace.net            ☎ +61 401 155 707
              ♽ made with 100 percent post-consumer electrons