Issue #2127 has been updated by gwar9999.
For a template, true.erb:
$ cat true.erb
/bin/true
$ wc -l true.erb
1 # no additional newlines
Puppetd logs a message:
command changed '/bin/true' to '/bin/true
'
notice the last single-quote (') is on the next line so puppet is comparing
"/bin/true" to "/bin/true\n". I logged the \n as the problem (since stripping
it off in the template with <% "" -%> works around the issue). However, the
problem could be that the existing crontab entry doesn't contain the newline,
such that puppet should be comparing "/bin/true\n" with "/bin/true\n".
The main point here is the fact that the crontab that puppet creates (has
newline) differs from the way puppet retrieves (no newline) it for comparison
purposes.
----------------------------------------
Bug #2127: cron resource adds newline when compiled from a template
http://projects.reductivelabs.com/issues/2127
Author: gwar9999
Status: Needs more information
Priority: Normal
Assigned to:
Category: cron
Target version:
Complexity: Trivial
Affected version: 0.24.7
Keywords:
If the template consists of a single line that does not end with a templated
variable or ruby code snippet then a newline is added to the cron command.
This causes an issue when puppet reapplies it's configuration since it always
compares "cmd" with "cmd\n" and thus recreates the crontab each time it runs.
if template contains "/bin/true" then a newline is appended. However, if the
template ends with a -%> then the newline is suppressed, so the following
workaround suffices "/bin/true <% "" -%>. This hack isn't elegant nor obvious,
but it appears to work.
----------------------------------------
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---