O'Reilly logo

Learning MCollective by Jo Rhett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Controlling Puppet

If you are using Puppet, you will be quite happy with the level of control MCollective gives you. MCollective can allow 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 4 above. 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 puppet client is installed on the host.

mcollective::plugin::agents:
  puppet:
    version: latest
    dependencies:
      - Package[%{hiera('puppet::client::package_name')}]
      - Service[%{hiera('puppet::client::service_name')}]

mcollective::plugin::clients:
  puppet:
    version: latest

Note

Obviously a bit redundant since Puppet is enforcing this policy so we already know that it is installed, but this makes for a good example since the mcollective agent for puppet can’t function without puppet installed.

Checking Puppet Status

Once you have installed the agent and restarted mcollectived (which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required