Skip to content

Instantly share code, notes, and snippets.

@pburkholder
pburkholder / devWrkstnConfig.ps1
Last active September 16, 2015 17:07 — forked from gryte/devWrkstnConfig.ps1
Windows Workstation Config for Dev Environment for Chef Cookbooks
# launch powershell with admin privileges
# run:
# install chocolately
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
# update to WMF 5 & powershell version 5
choco upgrade powershell -pre
# reboot machine
# launch powershell with admin privileges
@pburkholder
pburkholder / gist:dfa4b47e625e8f0784fe
Last active September 15, 2015 10:41 — forked from ncerny/gist:8d4aa3696e460668518f
Windows Development Kit for Chef
launch powershell with admin privileges
run:
Install-Package -name git -provider chocolatey
Install-Package -name chefdk -minimumVersion 0.6.0.1 -provider chocolatey
Install-Package -name atom -provider chocolatey
Open powershell window as user
apm install linter
@pburkholder
pburkholder / notes.md
Last active August 29, 2015 14:25
opscode manage install fail

chef-server-ctl install opscode-manage fails with undefined method uri' for LWRP resource apt_repository from cookbook apt`

chef-server 12.0.7 updated to 12.1.1 ubuntu 14.04

@pburkholder
pburkholder / snippet.sh
Created May 13, 2015 16:05
Manage chef server self-signed cert
openssl s_client -connect chefserver.com:443 -showcerts 2>/dev/null </dev/null | openssl x509 -outform PEM > /etc/chef/chef_server.pem
chmod 444 /etc/chef_server.pem
cat <<END>>/etc/chef/client.rb
ssl_ca_file '/etc/chef/cheef_server.pem'
END
@pburkholder
pburkholder / attributes.md
Created May 13, 2015 15:54
Attributes thinking...

Here's some of my thinking attributes:

  • use default levels, except when you can't

  • think of attributes in two ways

    • as the interface to the cookbook
    • as attributes of the node (not as variable in the cookbook)
      • e.g. node.network.ip - is a fact about the node
      • node.users.sudoers - is an attribute you are setting because you want it to be a fact
  • avoid ruby logic in attributes/default.rb

@pburkholder
pburkholder / customer_patch_policyfile.md
Created April 29, 2015 15:58
policyfile and workflow

Follow Up Questions/Discussion for whomever (re: Policyfiles)

What's the Current Security Update Worflow Like?

The web side of the company is doing something like the environment cookbook pattern, where each rev of an application has its own environment, and there ~150 apps. If I'm understanding this correctly, that means there are maybe ~500-1000 environments. So how does a heartbleed-type fix get rolled out? Just overwrite the existing cookbook? Iterate over the environments and update them with the new

@pburkholder
pburkholder / gist:a9cdde0b33be8d5e3c08
Created February 20, 2015 02:00 — forked from tyler-ball/gist:f7c16e814265f34260e9
Shared examples in rspec/serverspec.....

Create the following folder structure in your cookbook:

test
└── integrationq
    ├── helpers
    │   ├── serverspec
    │   │   ├── shared_serverspec_tests
    │   │   │   └── shared_tests2.rb
    │   │   └── spec_helper.rb
@pburkholder
pburkholder / aws_cli_example.sh
Last active August 29, 2015 14:15
How to use tag filter with aws ecs
aws ec2 describe-subnets --filter "Name=tag:Name,Values=isa-w2a"
aws ec2 describe-vpcs --filter "Name=tag:Name,Values=chef_ha_vpc"
aws ec2 describe-internet-gateways --filter "Name=tag:Name,Values=chef_ha_vpc"
aws ec2 detach-internet-gateway --internet-gateway-id igw-bb7daade --vpc-id vpc-4dea4228
aws ec2 delete-internet-gateway --internet-gateway-id igw-bb7daade
@pburkholder
pburkholder / selfsigned.md
Last active August 22, 2016 15:55
Poking at Supermarket and Berkshelf and self-signed certs

Notes

ssl testing

Even with ssl.verify off, berks install or berks vendor will fail when supermarket is using a self-signed certificate. So, how do we get around that?

Note: I hacked my /etc/hosts to resolve supermarket-0.c.cheffian-supermarket.internal

Get the CERT

@pburkholder
pburkholder / README.md
Created January 29, 2015 21:07
Supermarket notes