Hi, On 07/11/2012 08:02 PM, Rastio Hodul wrote: > Hi, > I'm new to Puppet. > > I'm writing the script that installs LAMP+Drupal. > > At the end of the script I need to setup a cron. But for that I need to > read certain key that has been generated during install. > So I'm trying use generate() function, BUT it evaluates during compile > time at which the key has not been generated yet.
it also evaluates on the *master*, not the agent, so you won't have any luck with that. > Is there any way to order the execution of functions (I guess not)? > Or, is there any other way to read something from database in a > controlled time and order? Tricky. I guess the canon approach would be to write a custom fact that retrieves the value for you after puppet has completed the setup on your agent. During the next agent run, the cron can be generated using the information from the fact. The manifest should look like this: if $myvalue { cron { "mycron": command => "/some/thing/with $myvalue ...", ... } } so that the cron will only be created once the fact is indeed available. HTH, Felix -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.