Issue #17810 has been updated by Sunny Jaisinghani. Status changed from Unreviewed to Closed Assignee set to Sunny Jaisinghani
I researched further and found that i was using single quotes which do not interpolate variables. I used double quotes with some escape sequences to substitute the facts in cron command. ---------------------------------------- Bug #17810: Can't substitute facts in cron command https://projects.puppetlabs.com/issues/17810#change-77458 Author: Sunny Jaisinghani Status: Closed Priority: Normal Assignee: Sunny Jaisinghani Category: Target version: Affected Puppet version: Keywords: cron, facts Branch: Hello, We are running puppet in different environments. The environment is nothing but a fact which is set in a file under /etc/puppetlabs/facter/facts.d Now, based on the facts, different cronjobs should be deployed on different hosts example: cron { "log_scrapper": ensure => present, command => '/usr/local/tools/bin/log_scrapper.pl --logfile=/var/log/messages --subject="Errors ($::environment)" [email protected]', user => 'root', minute => '*', } The above cronjob gets created, however, my subject line does not get replaced with the correct environment. Instead it prints the exact string as in the cron command. It seems cron type does not support these variable substitutions -- 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://projects.puppetlabs.com/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.
