Ask Your Question

how to run a puppet program on multiple servers..?

asked 2016-10-14 00:14:42 -0600

rohithmn03 gravatar image

Hi Guys,

I am new to puppet.! If i want to execute a specific puppet program (like say restart of some service) on 100 nodes. How can i do it with hiera..!? I mean, how can i put all my 100 server names in hiera and use the definition in manifest.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2016-10-14 08:43:06 -0600

DarylW gravatar image

Puppet isn't an orchestration framework, it is configuration management. While you can execute commands (exec), you generally don't want to execute commands on other instances, you want to describe the endstate. When you have the end state described in the puppet DSL, the master uses information from each of your nodes to build a catalog, and that catalog is applied to your nodes.

In your example, you can't tell puppet to 'restart X service on all the nodes that have it', you would tell puppet that the contents of a file should be X, and if they change, that file can notify the service. If a service gets notified, it will be restarted (to pick up the changes in the file).

If you are looking for running commands on your instances, PE has Application Orchestration, but until then their MCollective tool allows you to search for instances based on facter facts, or installed classes, and it allows you to tell those nodes to run commands, and it will return pass/fail information to you.

For a great discussion of thinking declaratively, see Ben Ford's blogpost -

Hope that helps!

edit flag offensive delete link more

answered 2016-10-16 21:13:27 -0600

Emerson Prado gravatar image

Following up on @DarylW answer: depending on the task you want to orchestrate, you can use MCollective. Restarting a service is a very simple task for MCollective. And it's close friends with Puppet.

edit flag offensive delete link more

answered 2016-10-14 07:18:06 -0600

puser gravatar image

You use node definitions to specify classes and assign servers to the those classes.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-10-14 00:14:42 -0600

Seen: 211 times

Last updated: Oct 16 '16