Skip to content

Instantly share code, notes, and snippets.

require 'chef/provisioning/aws_driver'
with_driver 'aws:default:us-west-1'
with_chef_server "https://api.opscode.com/organizations/spincycle",
:client_name => Chef::Config[:node_name],
:signing_key_filename => Chef::Config[:client_key]
node.set['ssh_key'] = 'thom_spincycle'
aws_key_pair node['ssh_key'] do
private_key_path ::File.expand_path("~/.ssh/#{node['ssh_key']}")
$chef_omnibus_root = "$env:systemdrive\opscode\chef"
$msi = "$env:TEMP\chef-12.3.0.msi"
$pretty_version = "12.3.0"
$version = "12.3.0"
$chef_msi_url = "https://opscode-omnibus-packages.s3.amazonaws.com/windows/2008r2/x86_64/chef-client-12.4.1-1.msi"
Function Check-UpdateChef($root, $version) {
if (-Not (Test-Path $root)) { return $true }
elseif ("$version" -eq "true") { return $false }
elseif ("$version" -eq "latest") { return $true }

Getting started

In the analytics directory, run rake converge.

Once the rake command has completed, you should be able to go to the Chef Web UI and log in with username analytics and password workshop.

Once logged in, download a private key for your user by going to the user's profile page, selecting reset key then copy the text into .chef/analytics.pem in this directory.

@thommay
thommay / gist:42b033d2c877e74e6b1a
Last active August 29, 2015 14:17
compile_time post mortem

Meeting

Start every PM stating the following

  1. This is a blameless Post Mortem.
  2. We assume everyone participating in the project wants to do a good job.
  3. We will not focus on the past events as they pertain to "could've", "should've", etc.
  4. All follow up action items must be actionable and have a participating individuals commitment to implement, design, or otherwise achieve them.

Post-mortem Facilitator: Thom May

plain_pass = Chef::EncryptedDataBagItem.load("aws-admin-passwords", "svc_goagent")["password"]
p plain_pass
#if unix box
if node['platform'] == 'ubuntu'
chef_gem "ruby-shadow"
package "whois"
unless node.attribute? "svc_goagent_pass"
def jj(p)
name = p.name.sub(/-cook/, " cook")
n_xml = Nokogiri::XML(@jenkins.client.job.get_config(name))
path = n_xml.xpath("//url").children.first
path.content = p.ssh_url_to_repo
gitlab = n_xml.xpath("//__projectPath").children.first
gitlab.content = p.web_url unless gitlab.nil?
@jenkins.client.job.post_config(name, n_xml.to_xml)
end
require 'pp'
require 'kitchen'
module Kitchen
module Driver
class Truthy < Kitchen::Driver::SSHBase
default_config :truthy, true
# A sample Guardfile
# More info at https://github.com/guard/guard#readme
require 'guard/guard'
require 'mixlib/shellout'
module ::Guard
class Kitchen < ::Guard::Guard
def start
::Guard::UI.info("Guard::Kitchen is starting")
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
default[::groups] = [ "foo","bar","baz" ]