Skip to Content
Learning MCollective
book

Learning MCollective

by Jo Rhett
August 2014
Intermediate to advanced
284 pages
5h 24m
English
O'Reilly Media, Inc.
Content preview from Learning MCollective

Chapter 8. Controlling Puppet Agent

In the previous chapter, we showed how to use Puppet to install and configure MCollective. In this chapter, we’re going to show you how MCollective can:

  • Use the Puppet classes applied to the node in filters

  • Use facts known by Puppet in filters

  • Query, start, stop, and restart the Puppet agent

  • Run the Puppet agent with special command-line options

  • Query and make changes to the node using Puppet resources

If you are using Puppet, you will be quite happy with the level of control MCollective gives you. MCollective allows new ways of using Puppet that simply aren’t possible from agent, cron-run, or even command-line usage of Puppet.

Install the Puppet Agent

The first thing we need to do is install the MCollective Puppet agent. Installation of this is identical to the agents we installed in Chapter 5. Since we know you have Puppet installed, we’ll dispense with the command-line installation and show you to do it with Puppet: 

node nodename {
  mcollective::plugin::agent  { 'puppet': }  # for servers
  mcollective::plugin::client { 'puppet': }  # for clients
}

If you use Hiera, you can install the agent with a simple listing of the Puppet agent in the mcollective::plugin::agents array. In this example, we’re going to show you an example where we set the Puppet agent dependencies to ensure that the Puppet client is installed on the host:

 mcollective::plugin::agents: puppet: version: latest dependencies: - Package[%{puppet::client::package_name}] ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Russell Rules

Russell Rules

Bill Russell
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally
How You Play the Game

How You Play the Game

Jerry Colangelo, Len Sherman

Publisher Resources

ISBN: 9781491945681Errata