Skip to content

Instantly share code, notes, and snippets.

Brett brettswift

View GitHub Profile
@brettswift
brettswift / blaster.sh
Created Nov 4, 2019
cdk deploy scripting - gathering outputs in a bash script
View blaster.sh
#!/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 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
brettswift / hieradata.yaml
Last active Mar 22, 2016
nested hiera lookup
View hieradata.yaml
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 Feb 12, 2016
beaker ec2 module not found
View ec2box.info
[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
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
brettswift / pe_migration_3-3_to_3-8.sh
Created Jun 11, 2015
Puppet cert migration from 3.3 to 3.8
View pe_migration_3-3_to_3-8.sh
#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 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|
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 Mar 8, 2012
brew install gource bug
View gist:2002200
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.
You can’t perform that action at this time.