Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes I want to run a command one time on all servers, e.g.

service ntpd stop
ntpdate ntp3.domain.local
service ntpd start

How can I make Puppet run this command once on all servers? I want to avoid this command being run every 30 minutes.

And if Puppet isn't the right tool for this, then what is?

share|improve this question
MCollective is probably what you want to look at. – Michael Hampton Sep 19 '13 at 20:36
Also, if you use ntpdate -u you don't have to stop ntpd. – DerfK Sep 19 '13 at 21:09

What you are looking for is probably an at job: Examples for at jobs

share|improve this answer

Take a look at the 'unless' parameter of exec.

For example, you can add one last command to touch a file, and use 'cat filename' in your 'unless' parameter. If the file exists, the exec won't run :)

share|improve this answer
Same idea with 'onlyif', btw ;) – netelligentChris Sep 20 '13 at 0:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.