Forge Home

puppetpem2p12

Extend your Puppet CA for use on your Windows platform. Converts PEM files to the P12 format and installs them in the Certificate Manager.

9,456 downloads

9,274 latest version

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

  • 0.0.2 (latest)
  • 0.0.1
released Dec 8th 2015
This version is compatible with:

Start using this module

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

Add this module to your Puppetfile:

mod 'new23d-puppetpem2p12', '0.0.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add new23d-puppetpem2p12
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install new23d-puppetpem2p12 --version 0.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
Tags: ssl, ca, tls, pem, p12, puppetca

Documentation

new23d/puppetpem2p12 — version 0.0.2 Dec 8th 2015

puppetpem2p12

Extend your Puppet CA (Certificate Authority) for use on your MS Windows infrastructure. Converts PEM files to the P12 format and installs them in the Certificate Manager too.

Common uses could be an HTTPS WinRM setup, IIS, etc. and the ability to trust other certificates issued by your Puppet CA.

This module add two facts from puppet config:

puppet_config_ssldir which is the path to the directory containing SSL related files.

puppet_config_localcacert which is the path to the CA certificate's .PEM file on the agent side.

The module also provides three new types:

puppetpem2p12 this simply converts the .PEM format certificate and private key into a .P12 format file.

p122certmgr this installs a given .P12 file into the MS Windows Certificate Manager.

pem2certmgrCA this installs the Puppet CA's public certificate into the MS Windows Trusted Root Certification Authorities Certificate Store - so that other certificates issued by this Puppet CA can be trusted.

Example

# store the paths of various directories and file names in variables for convenience
$p12_dir = "${::puppet_config_ssldir}/p12"
$p12_path = "${p12_dir}/${::fqdn}.p12"

# P12 format needs a password
$p12_password = fqdn_rand(42)

# optionally print the password to the password protected .P12 file
notify {$p12_path:
  message => "Password to ${p12_path} is ${p12_password} ."
}

# create a new directory to store the .P12 file
file {$p12_dir:
  ensure => directory,
}

# convert the agent side certificate and private key to .P12 format and save it at $p12_path
puppetpem2p12 {$p12_path:
  ensure   => present,
  password => $p12_password,
}

# install the P12 certificate into the MS Windows Certificate Manager
p122certmgr {$p12_path:
  ensure   => present,
  password => $p12_password,
}

# Optionally install the Puppet CA's public certificate into MS Windows Trusted Root Certification Authorities Certificate Store
pem2certmgrCA {$::puppet_config_localcacert:
  ensure => present,
}