Skip to content

Instantly share code, notes, and snippets.

View fvoges's full-sized avatar
:octocat:

Federico Voges fvoges

:octocat:
View GitHub Profile
@fvoges
fvoges / bash-colorscheme.sh
Created April 17, 2017 17:20
ANSI color scheme script featuring Space Invaders
#!/usr/bin/bash
#
# ANSI color scheme script featuring Space Invaders
#
# Original: http://crunchbang.org/forums/viewtopic.php?pid=126921%23p126921#p126921
# Modified by lolilolicon
#
f=3 b=4
for j in f b; do
@fvoges
fvoges / backup.pp
Created April 17, 2017 21:01
Puppet Enterprise Backup Profile
# requires these modules
# https://github.com/npwalker/pe_databases
# https://github.com/fvoges/puppet-pe_backup
# Profile profile::puppet::backup
class profile::puppet::backup {
$destination = hiera('profile::puppet::backup::destination')
include ::pe_databases::backup
file { $destination:
@fvoges
fvoges / openvpn.pp
Created January 2, 2018 15:15
OpenVPN Puppet Profile
class profile::vpn::openvpn (
String $servername = $trusted['certname'],
String $ca_country,
String $ca_provice,
String $ca_city,
String $ca_organization,
String $ca_email,
Integer $port,
Array $clients,
Optional $revoked = undef,
@fvoges
fvoges / hiera.yaml
Last active August 13, 2018 08:37
Hiera v5 example config
---
version: 5
defaults:
datadir: data
lookup_key: eyaml_lookup_key
options:
pkcs7_private_key: /etc/puppetlabs/secure/keys/private_key.pkcs7.pem
pkcs7_public_key: /etc/puppetlabs/secure/keys/public_key.pkcs7.pem
hierarchy:
@fvoges
fvoges / apache_spec.rb
Last active March 21, 2019 17:15
Puppet Practitioner Apache rspec-puppet example using pdk convert
require 'spec_helper'
describe 'apache' do
on_supported_os.each do |os, os_facts|
context "on #{os}" do
let(:facts) { os_facts }
it { is_expected.to compile }
it {
case facts[:osfamily]
@fvoges
fvoges / centrify_simple.rb
Created December 6, 2018 15:57
Simple and structured custom fact examples
# This custom fact is confined to RedHat and derivatives and
# returns a simple fact (string)
Facter.add('centrify') do
confine Facter.value(:os)['family'] => 'RedHat'
setcode do
query = Facter::Core::Execution.execute('rpm -q --qf %{VERSION} CentrifyDC')
if query =~ /\d+\.\d+/
query
else
@fvoges
fvoges / bitbucket.md
Created December 10, 2018 10:44
How to configure the webhook for Puppet Enterprise's Code Manager in BitBucket server

BitBucket

  1. Install BitBucket
  2. Make a Project called puppet (with a short name of PUP)
  3. Create a repository called control-repo
    • Create a user called r10k with a password of puppet.
    • Make the r10k user an admin of the PUP project.
  4. Either use the admin user to test pushing code, or create a user for yourself and add your SSH key to that user.
  • If making a user for yourself, give your user account read/write or admin privilege to the PUP project.
@fvoges
fvoges / gist:2f98a7350ce0b4fe229449343adbf5be
Last active April 25, 2019 16:19 — forked from kbarber/gist:6456420
Renewing a Puppet CA cert
Renew Puppet CA cert.
Not the perfect idea, but should alleviate the need to resign every cert.
What you need from existing puppet ssl directory:
ca/ca_crt.pem
ca/ca_key.pem
Create an openssl.cnf:
[ca]
@fvoges
fvoges / keybase.md
Created October 17, 2019 12:15
keybase.md

Keybase proof

I hereby claim:

  • I am fvoges on github.
  • I am boatsuk (https://keybase.io/boatsuk) on keybase.
  • I have a public key ASBUkaQqfKypWgZPPOp8ysQ1j2ZyaToOWGCqrOwsliuW7wo

To claim this, I am signing this object:

@fvoges
fvoges / binaries_download.sh
Last active November 3, 2023 11:33
Useful HashiCorp binaries scripts
#!/usr/bin/env bash -e
# Original source: https://gist.github.com/greenbrian/2e9e90d65c3d272c48b14dd3b3f19153
DEPS="curl jq unzip wget"
for cmd in $DEPS
do
if ! which -s $cmd
then
echo "$cmd command not found!"
echo "Ensure that you have the following tools installed and in your \$PATH: ${DEPS}"