Forge Home

mcollective

Setup and configure MCollective server, client and user on RedHat/CentOS and Debian

10,226 downloads

9,721 latest version

3.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.2.1 (latest)
  • 0.2.0
  • 0.1.0
released Jan 9th 2015
This version is compatible with:
  • Puppet 3.x
  • , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'lbetz-mcollective', '0.2.1'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add lbetz-mcollective
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install lbetz-mcollective --version 0.2.1

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

lbetz/mcollective — version 0.2.1 Jan 9th 2015

#puppet-mcollective

##Overview Puppet module to manage MCollective server, client and user. Only SSL certifikate authentication is supported, yet. Also supports activemq only. But has to be expanded easily for other message queues like rabbitmq, just a few lines in some config files have to change. ##Module Description

###Compatibility This module uses packages from puppetlabs and runs on RHEL/Centos and Debian. Actually it's testet on Debian 6 and CentOS 6.

###Requirements

  • Puppet 3.x
  • puppetlabs/stdlib >= 3.2.2

You must run puppet in agent mode and certicicates have to be found in /var/lib/puppet/ssl.

##Setup

##Usage

###Beginning with MCollective Requires a puppet setup with a master and stored configs enabled. An installed ActiveMQ using SSL certificates. User certificates can used from puppet CA, created by 'puppet cert generate'.

First we wanna install a server connecting to an activemq on host master using the default port. The argument 'agents' put the packages for the given agents on the host. The private key and the signed certificate here is set as string in base64.

class { 'mcollective::server':
  agents => ['package', 'puppet', 'service', 'nettest', 'nrpe'],
  mqueue => {
    host     => 'master',
    password => 'gruelfin',
  },
  key    => '-----BEGIN RSA PRIVATE KEY-----
MIIJK....
-----END RSA PRIVATE KEY-----',
  cert   => ''-----BEGIN CERTIFICATE-----
MIIFX...
-----END CERTIFICATE-----',
}

If you wanna use keys and certificates are stored in files leave arguments key and cert out.

class profiles::base {
  class { 'mcollective::server':
    mqueue => {
      host     => 'master',
      password => 'gruelfin',
    },
  }
}

The files for key end certificate then must saved in files/private_keys and files/certs repectively of the calling module like a profiles class. Both files have to be named mcollecive-servers.pem.

modules
|-- mcollective
`-- profiles
  `-- files
    |-- private_keys
    |  `-- mcollective-servers.pem
    ´-- certs
      `-- mcollective-servers.pem

###Installing a client including an user Now we're installing the client package and additionally the packages for the client base usage of the puppet, packages, service, nettest and nrpe services. And we use the root account on this host to connect the message queue on 'master'. The necessary configuration file '.mcollective', the client key and certificate ('.mcollective.d') are stored in the given home directory '/root'. The client key and certificate are named 'foo.pem'.

class { 'mcollective::client':
  plugins => ['puppet', 'packages', 'services', 'nettest', 'nrpe'],
}

mcollective::client::user { 'foo':
  user   => 'root',
  owner  => 'root',
  home   => '/root',
  mqueue => {
    host     => 'master',
    password => 'gruelfin',
  },
}

Here we used for the key and the certivicates, client and mcollective-servers certs, files like above in the server configuration. That means both declarations are contained by another class, i.e. profiles, the mcollective module takes it outta this profiles module's files directory.

modules
|-- mcollective
`-- profiles
  `-- files
    |-- private_keys
    |  `-- foo.pem
    ´-- certs
      |-- foo.pem
      `-- mcollective-servers.pem

###Classes and Defined Types

####Class: mcollective::server Parameters within mcollective:

#####ensure present or running (present), stopped

#####enable Enables (true, default) or disables (false) the service to start at boot.

#####agents List (array) of agents have to be installed.

#####key Private session key to use. Default is a base coded file, source gets from ${caller_module_name}/private_keys/mcollective-servers.pem on the puppetmaster.

#####cert Session certificate to use. Default is a base coded file, source gets from ${caller_module_name}/certs/mcollective-servers.pem on the puppetmaster

#####mqueue Parameters hash for MQ connection. Defaults are: host => 'puppet', port => '61614', user => 'mcollective', password => 'marionette',

####Class: mcollective::client

#####plugins List (array) of plugins have to be installed. Defaults are 'package', 'puppet' andf 'service'.

####Defined Type: mcollective::server::agent

#####ensure Installs agent (present) or removes (absent). Default is present.

#####agent Sets the agent name, default is the title.

#####package Use this package name for installation. Default: mcollective-${agent}-agent

####Define Type: mcollective::client::plugin

#####ensure Installs plugin (present) or removes (absent). Default is present.

#####plugin Sets the plugin name, default is the title.

#####package Use this package name for installation. Default: mcollective-${plugin}-client

####Defined Type: mcollective::client::user

#####certname Name of the certificate file, the suffix .pem is automatically added. Default is the 'title' of the define resource.

#####user User to use and the owner of all files. Default is the 'title'.

#####group Group to use and the group of all files. Default is the 'title'.

#####home The home directory of the chosen user. Default ist the '/home/title'.

#####server_cert The mcolelctive session certificate. By default a file mcollective-servers.pem is taken from the puppetmaster out of ${caller_module_name}/certs/.

#####key Private key of the user, base64 coded. By default a file user.pem is taken from the puppetmaster out of ${caller_module_name}/certs/.

#####cert User certificate, base64 coded. By default a file user.pem is taken from the puppetmaster out of ${caller_module_name}/private_keys/.

#####mqueue Parameters hash for MQ connection. Defaults are: host => 'puppet', port => '61614', user => 'mcollective', password => 'marionette',