Skip to content

Instantly share code, notes, and snippets.

View tom-krieger's full-sized avatar

Thomas Krieger tom-krieger

View GitHub Profile
---
Gemfile:
optional:
':development':
- gem: 'github_changelog_generator'
git: 'https://github.com/skywinder/github-changelog-generator'
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
- gem: 'puppet_litmus'
git: 'https://github.com/puppetlabs/puppet_litmus.git'
@tom-krieger
tom-krieger / root-openssl.cnf
Last active October 1, 2021 06:47
openssl.cnf fiel for the Root CA
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
@tom-krieger
tom-krieger / intermediate-openssl.cnf
Last active October 1, 2021 06:46
openssl.cnf file for the Intermediate CA
#
# OpenSSL example configuration file.
# This is mostly being used for generation of certificate requests.
#
# This definition stops the following lines choking if HOME isn't
# defined.
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
@tom-krieger
tom-krieger / setup_root_and_intermediate_ca.sh
Last active May 4, 2022 13:15
Script to setup the root and intermediate CA
#!/bin/bash
BASEDIR="/root/ca"
ROOTCA="${BASEDIR}/root_ca"
PUPPETCA="${BASEDIR}/puppet"
mkdir -p "${ROOTCA}"
mkdir -p "${PUPPETCA}"
# setup the root ca
@tom-krieger
tom-krieger / upload_crl.sh
Last active January 20, 2022 12:51
Script to upload a crl to PE
#!/bin/bash
if [ $# -ne 1 ] ; then
prog=`basename $0`
echo "usage: $prog <crl file>"
exit 2
fi
type_header='Content-Type: text/plain'
cert="$(puppet config print hostcert)"
@tom-krieger
tom-krieger / upload_new_crl.json
Created January 25, 2022 08:03
Upload new CRL task
{
"description": "Upload a new crl file to the Puppet Primary server. The crl file must be provided in PEM format.",
"input_method": "environment",
"parameters": {
"crl_file": {
"description": "File with new certificate revolcation lists to upload.",
"type": "String[1]"
}
}
}
@tom-krieger
tom-krieger / crl_upload.pp
Created January 25, 2022 08:22
url_upload
# @summary Upload new crl to puppet primary
#
# This code example used the same shell script as the task to upload a new crl
# ito Puppet Primary server. Keep in mind that running this class the first time
# will fire the upload task and upload the crl in this repository.
#
class profile::crl_upload (
Stdlib::Absolutepath $crl_base_dir = '/usr/share/crl_upload',
) {
$crl_file = "${crl_base_dir}/crl/crl.pem"