Skip to content

Instantly share code, notes, and snippets.


Brett brettswift

View GitHub Profile
brettswift /
Created Nov 4, 2019
cdk deploy scripting - gathering outputs in a bash script
#!/usr/bin/env bash
# Goal: run cdk apps, parse output like URL's to run a quick smoke test after the deploy
set -e
rm -rf ${CDK_DEPLOY_OUTPUT_FILE} # so this script doesn't drive us insane
brettswift / CfnInitMetadataBuilder.ts
Last active Apr 12, 2020
CDK 1.10.1 - ASG Cloudformation Init example
View CfnInitMetadataBuilder.ts
import autoscaling = require("@aws-cdk/aws-autoscaling")
import scriptAssets = require("./CfnInitScriptAsset")
import iam = require('@aws-cdk/aws-iam')
import cdk = require('@aws-cdk/core')
* Helpful context into what was built.
* Use these to get logical ID's when constructing your userdata.
brettswift / hieradata.yaml
Last active Mar 22, 2016
nested hiera lookup
View hieradata.yaml
group_allocation: smokestack smokestack smokestack the091 the091 the091 dev_master tst_master brett_sandbox
brettswift /
Created Feb 12, 2016
beaker ec2 module not found
[root@centos-64-x64 ~]# ll /etc/puppetlabs/code/modules/
total 8
drwxr-xr-x. 7 root root 4096 Feb 12 15:57 shaw_firewall
drwxr-xr-x. 6 root root 4096 Feb 12 15:56 stdlib
[root@centos-64-x64 ~]# ll /etc/puppetlabs/code/modules/shaw_firewall/
total 32
-rw-r--r--. 1 root root 210 Feb 12 15:57 beaker_docker_tips
-rw-r--r--. 1 root root 265 Feb 12 15:57 CHANGELOG
drwxr-xr-x. 2 root root 4096 Feb 12 15:58 ci
View r10k result
INFO -> Deploying environment /etc/puppetlabs/code/hostdata/hotfix_matrix037
INFO -> Deploying environment /etc/puppetlabs/code/hostdata/live
ERROR -> wrong argument type nil (expected String)
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/rugged-0.21.4/lib/rugged/repository.rb:33:in `[]'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/rugged-0.21.4/lib/rugged/repository.rb:33:in `checkout'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/r10k-2.0.3/lib/r10k/git/rugged/working_repository.rb:69:in `block in checkout'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/r10k-2.0.3/lib/r10k/git/rugged/base_repository.rb:46:in `with_repo'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/r10k-2.0.3/lib/r10k/git/rugged/working_repository.rb:68:in `checkout'
/opt/puppetlabs/puppet/lib/ruby/gems/2.1.0/gems/r10k-2.0.3/lib/r10k/git/rugged/thin_repository.rb:51:in `checkout'
brettswift / accounts::init.pp
Created Oct 16, 2015
Puppet Accounts module
View accounts::init.pp
class accounts (
$virtual_accounts = {},
$defaults = {},
) {
$realize = hiera_array('accounts')
group { 'sudo-dev':
ensure => present,
gid => 514,
brettswift /
Created Jun 11, 2015
Puppet cert migration from 3.3 to 3.8
#Note: those with a gap between, run them individually (ie you may not want to copy multiple lines if there are spaces. Prompts will prevent subsequent lines from being pasted)
#Part 1 - Allow remote ssh commands to old puppet master
# comment out "Defaults requiretty" in /etc/sudoers on the 'old' puppet master to enable remote scripting. :)
#Part 2 follow this walkthrough:
#Walkthrough Step 1: Shut down all PE-related services
puppet resource service pe-puppet ensure=stopped
puppet resource service pe-puppetserver ensure=stopped
brettswift / Vagrantfile
Created Jul 5, 2014
vagrant rackspace error: "No host IP was given to the Vagrant core NFS helper. This is an internal error that should be reported as a bug."
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.define :suite_brettswift_com do |nodeserver|
config.vm.provider :rackspace do |rs, override| = "rackspace"
override.vm.box_url = ""
rs.username = "#{ENV['RACKSPACE_USERNAME']}"
brettswift / gist:2002200
Created Mar 8, 2012
brew install gource bug
View gist:2002200
bash local $ brew install -v gource
==> Cloning
Updating /Users/bswift/Library/Caches/Homebrew/gource--git
git remote set-url origin
git fetch origin
git fetch --tags
==> Checking out tag gource-0.37
git checkout gource-0.37
HEAD is now at 1e12d58... Check for unsetenv.
You can’t perform that action at this time.