Skip to content

Instantly share code, notes, and snippets.

# 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")
require 'pp'
require 'kitchen'
module Kitchen
module Driver
class Truthy < Kitchen::Driver::SSHBase
default_config :truthy, true
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
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"
@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

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.

$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 }
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']}")
@thommay
thommay / kitchen build instructions
Last active August 29, 2015 14:27
delivery windows builder notes

has to be a 64bit toolchain - ie by installing ruby 64 and hence the 64 bit dev toolchain OPENSSL_LIB_DIR=C:\OpenSSL-Win64 OPENSSL_INCLUDE_DIR=C:\OpenSSL-Win64\include

rust nightly via straight windows_package -

windows_package 'rust' do
  source 'https://static.rust-lang.org/dist/2015-08-17/rust-nightly-x86_64-pc-windows-gnu.msi'
end

Release 8.6.0

  • Phil Dibowitz:
    • Provide a new and improved filesystem plugin for Linux & Mac (filesystem2), to support CentOS7, multiple virtual filesystems, etc.
    • Fix Darwin filesystem plugin on newer MacOSX
  • Jonathan Amiez:
    • Linux filesystems plugin report wrong fs-type for logical volumes
  • involucelate
    • Fix Windows 2008 hostname truncation #554
  • Pavel Yudin: