Ask Your Question

Ad-hoc commands with Puppet

asked 2014-05-21 10:48:31 -0500

Liam gravatar image

I am currently in the process of assessing different CM tools for our organization. I have tried to do some research but cannot find where Puppet (OS version) stores inventory file.

For example, I want a group called "web servers" in which I would have a certain number of servers. I want to be able to issue ad-hoc commands to this "web servers" group. Such as reboot, shutdown, date etc.

I saw mcollective does something like this, but I could not find anywhere where this list is stored and how I can group the inventory servers.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-05-21 13:42:07 -0500

Ancillas gravatar image

I've not used mCollective outside of Puppet Enterprise, but I found a few links that might help you get going. It's definitely hard to find these if you don't know what to look for.

When just using Puppet (no mCollective), the Puppet agents on the clients use Facter facts to generate a bunch of info about a server, and then send that to the Puppet master. The Puppet master then uses that information to classify the node, and then compile a catalogue (the configs to be applied on the client). The compiled catalogue is sent back to the client, and is then executed.

The Master can use a few methods to classify a node (linked above). The easiest is to use node classifiers in site.pp. You can use a regex to match on hostnames to apply configs.

It looks like mCollective can target nodes based on Puppet meta-data including what classes have been applied, or facts that have been applied. I'm guessing this utilizes PuppetDB, which stores the results of Puppet runs. What this means for you is that if you have a class called "yourwebapp", you could then instruct mCollective to run an arbitrary command on any server that has applied the "yourwebapp" class.

edit flag offensive delete link more


Thanks. I will do some reading on these.

Liam gravatar imageLiam ( 2014-05-21 13:47:07 -0500 )edit

Your Answer

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

Add Answer

Question Tools


Asked: 2014-05-21 10:48:31 -0500

Seen: 433 times

Last updated: May 21 '14