Skip to content

Instantly share code, notes, and snippets.

View brettswift's full-sized avatar

Brett brettswift

  • Calgary
View GitHub Profile
@brettswift
brettswift / blaster.sh
Created November 4, 2019 15:48
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
ACTION='deploy'
NAMESPACE=$(whoami)
CDK_DEPLOY_OUTPUT_FILE='.cdk_deploy_result'
rm -rf ${CDK_DEPLOY_OUTPUT_FILE} # so this script doesn't drive us insane
@brettswift
brettswift / CfnInitMetadataBuilder.ts
Last active October 2, 2022 20:36
CDK 1.10.1 - ASG Cloudformation Init example
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
brettswift / hieradata.yaml
Last active March 22, 2016 21:04
nested hiera lookup
group_allocation:
devcoreoeml030.matrix.sjrb.ad: smokestack
devcorebrml030.matrix.sjrb.ad: smokestack
devcoreesbl030.matrix.sjrb.ad: smokestack
devcoreoeml091.matrix.sjrb.ad: the091
devcorebrml091.matrix.sjrb.ad: the091
devcoreesbl091.matrix.sjrb.ad: the091
devcorepptl003.matrix.sjrb.ad: dev_master
tstcorepptl003.matrix.sjrb.ad: tst_master
devcorepptl918.matrix.sjrb.ad: brett_sandbox
@brettswift
brettswift / ec2box.info
Created February 12, 2016 16:05
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
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
brettswift / accounts::init.pp
Created October 16, 2015 12:27
Puppet Accounts module
class accounts (
$virtual_accounts = {},
$defaults = {},
) {
$realize = hiera_array('accounts')
group { 'sudo-dev':
ensure => present,
gid => 514,
@brettswift
brettswift / pe_migration_3-3_to_3-8.sh
Created June 11, 2015 14:08
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: http://docs.puppetlabs.com/pe/latest/trouble_regenerate_certs_monolithic.html
#Walkthrough Step 1: Shut down all PE-related services
puppet resource service pe-puppet ensure=stopped
puppet resource service pe-puppetserver ensure=stopped
@brettswift
brettswift / Vagrantfile
Created July 5, 2014 20:01
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."
Vagrant.configure("2") do |config|
config.vm.define :suite_brettswift_com do |nodeserver|
config.vm.provider :rackspace do |rs, override|
override.vm.box = "rackspace"
override.vm.box_url = "https://github.com/mitchellh/vagrant-rackspace/raw/master/dummy.box"
rs.username = "#{ENV['RACKSPACE_USERNAME']}"
@brettswift
brettswift / gist:2002200
Created March 8, 2012 17:24
brew install gource bug
bash local $ brew install -v gource
==> Cloning https://github.com/acaudwell/Gource.git
Updating /Users/bswift/Library/Caches/Homebrew/gource--git
git remote set-url origin https://github.com/acaudwell/Gource.git
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.