Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
3  
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
add comment

2 Answers 2

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

share|improve this answer
add comment

Take a look at the 'unless' parameter of exec. http://docs.puppetlabs.com/references/latest/type.html#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
add comment

Your Answer

 
discard

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.