I'm wondering if anyone knows a good way to get the date and time when a portion of code in a Puppet manifest is actually executed. Sometimes my manifests take a long time to run, and I need to schedule a task to occur soon after the end of the run, no matter when that occurs.
I have tried the time() function, setting a variable using generate() (using the date function on the Puppet master), and even creating a custom fact, but everything I've tried gets evaluated when the manifests are parsed on the server, rather than when they actually execute on the client.
Any ideas? The clients are all Windows, FWIW.
Thanks in advance!
Ugh, that's too bad.
Also FWIW, I did this on linux using "echo <task> | at now+3min", which
works out of the box as long as "atd" is running.
Perhaps a similar crutch can be created using the Windows Task Scheduler.
You could try wrapping your task in a script that defers running it until the agent's lock file disappears. That would be cleaner and at least slightly more elegant.
John