Thanks John. Yes I realised that from going through the crontab.rb
and parsedfile.rb scripts.
You are absolutely correct that there is nothing that could easily be
lifted and used on top of puppet.
I believe that, in order to make this work, a change would be required
to one or more of the core template funtions in puppet - possibly to
add a "flag" to say to include the last-updated header (or call a
separate templateWithHeader function) , and to later ignore it when
parseing the files to check for changes. The fact that the comment
marker would be different in some cases does complicate matters - but
not insurmountably. It could default to being determined based on the
file extension (the part before the .erb) and the function could take
a parameter that overwrode it if required. It's a common process when
auto-generating source file headers for copyright in maven projects
for example (where there are some java files, some sql files, some xml
files etc).
I'm actually a Java guy by background so am loving the power of puppet
but struggling someone to make anything more than the most basic
puppet functions. That said, if I get the chance I would love to code
or contribute to an enhancement like this, if it would be valued by
the community.
For me, the benefit of the header is being able to immediately tell
whether the file has been modified by someone or something since the
last puppet run (by comparing the header to the last modified
timestamp on the file). It's very helpful when fault-finding. It
also gives a nice straightforward view (from within the file itself)
of the last time it changed - again helping to narrow down the source
of problems.
Would others find it useful? If so I could raise a feature request
for it to open a formal discussion, and (one day, maybe!) fork and
contribute to the code.
James
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/puppet-users/-/XN7EX_wBe2EJ.
> To post to this group, send email to
puppet...@googlegroups.com.
> To unsubscribe from this group, send email to
>
puppet-users...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/puppet-users?hl=en.