http://projects.puppetlabs.com/projects/mcollective-plugins/wiki
Repo: https://yum.puppetlabs.com/el/6/products/x86_64/
- MCollective Puppet plugin: this is to run many puppet commands. Ref: https://github.com/puppetlabs/mcollective-puppet-agent
- MCollective Service plugin: this is to run many service commands. Ref: https://github.com/puppetlabs/mcollective-service-agent
Each of them has:
- agent, to be installed on each mcollective server/node
- client, to be installed on mcollective client only
- common, need to be installed on both node and agent.
After you install client on mcollective client, then you can run plugin.
Examples:
To put all puppet to sleep:
mco rpc puppet disable message="sleep for now"
If later needs to wake them up again
mco rpc puppet enable
To wake up one server:
mco rpc puppet enable -I puppetclient.demo
Run puppet once on all nodes, 3 nodes per 60 seconds.
# mco puppet runonce --batch 3 --batch-sleep 60 / [ ======================> ] 9 / 125
Or to run 5 concurrent puppet:
# mco puppet runall 5
To run once on specific host:
mco puppet runonce -I puppetclient.demo
Note:
- Only enabled server can run puppet. If puppet is disabled, you need to enable it first.
- If puppet is called for reload or run once, it won’t generate systems log.
Puppet summary:
# mco puppet summary
Summary statistics for 125 nodes: Total resources: ▂▇▄▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ min: 150.0 max: 155.0 Out Of Sync resources: ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ min: 0.0 max: 0.0 Failed resources: ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ min: 0.0 max: 0.0 Changed resources: ▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ min: 0.0 max: 0.0 Config Retrieval time (seconds): ▇▅▁▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ min: 1.1 max: 6.7 Total run-time (seconds): ▄▂▃▇▃▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁ min: 9.4 max: 19.2 Time since last run (seconds): ▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▃▅▇▅ min: 1.6k max: 6.0k
mco service mcollective restart -I anode.com
mco service sshd status –np -v -I anode.com
mco service httpd status –np]]>