Forge Home

mcollective_agent_puppetca

Agent to manage Puppet certificates

37,118 downloads

26,642 latest version

2.6 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.

Version information

  • 4.0.2 (latest)
  • 4.0.1
  • 4.0.0
  • 3.0.0
released Mar 4th 2019
This version is compatible with:
  • Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.4.x
  • Puppet >= 4.9.0

Start using this module

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

Add this module to your Puppetfile:

mod 'choria-mcollective_agent_puppetca', '4.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add choria-mcollective_agent_puppetca
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install choria-mcollective_agent_puppetca --version 4.0.2

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

choria/mcollective_agent_puppetca — version 4.0.2 Mar 4th 2019

Choria PuppetCA Agent

The puppetca agent lets you sign, list, revoke, clean and determine the status of certificates on your Puppet Certificate Authorities

Actions

This agent provides the following actions, for details about each please run mco plugin doc agent/puppetca

  • clean - Performs a puppetca --clean on a certficate
  • list - Lists all requested and signed certificates
  • revoke - Revokes a certificate by doing the same as clean
  • sign - Signs a certificate request
  • status - Find a certificate's status

Agent Installation

Add the agent and client:

mcollective::plugin_classes:
  - mcollective_agent_puppetca

Configuration

You can configure the path to the Puppet Cert command via Hiera:

mcollective_agent_puppetca::config:
  puppetca: /bin/puppet cert

The default path is /opt/puppetlabs/bin/puppet cert

Usage

List

% mco rpc puppetca list
Discovering hosts using the mc method for 2 second(s) .... 1

 * [ ============================================================> ] 1 / 1


puppetca.example.com
   Waiting CSRs: ["host2.example.com", "host3.example.com"]
         Signed: ["host1.example.com", "host4.example.com"]



Finished processing 1 / 1 hosts in 67.85 ms

Sign

% mco rpc puppetca sign certname=host3.example.com
Discovering hosts using the mc method for 2 second(s) .... 1

 * [ ============================================================> ] 1 / 1


puppetca.example.com                             Unknown Request Status
   Already have a certificate for host3.example.com. Not attempting to sign again



Finished processing 1 / 1 hosts in 48.25 ms

Revoke

% mco rpc puppetca revoke certname=host1.example.com
Discovering hosts using the mc method for 2 second(s) .... 1

 * [ ============================================================> ] 1 / 1


puppetca.example.com
   Result: Notice: Revoked certificate with serial 35
           Notice: Removing file Puppet::SSL::Certificate host1.example.com at '/var/lib/puppet/ssl/ca/signed/host1.example.com.pem'
           Notice: Removing file Puppet::SSL::Certificate host1.example.com at '/var/lib/puppet/ssl/certs/host1.example.com.pem'
           Notice: Removing file Puppet::SSL::CertificateRequest host1.example.com at '/var/lib/puppet/ssl/certificate_requests/host1.example.com.pem'
           Notice: Removing file Puppet::SSL::Key host1.example.com at '/var/lib/puppet/ssl/private_keys/host1.example.com.pem'



Finished processing 1 / 1 hosts in 1882.27 ms

Status

% mco rpc puppetca status certname=host2.example.com
Discovering hosts using the mc method for 2 second(s) .... 1

* [ ============================================================> ] 1 / 1


puppetca.example.com
  Result: awaiting signature



Finished processing 1 / 1 hosts in 56.76 ms

Data Plugin

The Puppetca agent also supplies a data plugin which uses the Puppetca agent to check the current status of a certificate. The data plugin will return 'signed', 'waiting' and 'missing', and can be used during discovery or any other place where the MCollective discovery langauge is used.

In this example we lookup all nodes that have a cert "host2.example.com" in a waiting state.

% mco find -S "puppetca('host2.example.com').status=waiting"
puppetca.example.com