Skip to content

Instantly share code, notes, and snippets.

View fnichol's full-sized avatar

Fletcher Nichol fnichol

View GitHub Profile
@fnichol
fnichol / README.md
Last active April 27, 2023 15:24
Auto-enable Local HTTP Caching in Test Kitchen

Auto-enable Local HTTP Caching in Test Kitchen

Note: total experiment and hack, looks nasty, could be awesome:

Setup

  • Drop the kitchen.local.yml into $HOME/.kitchen/config.yml
  • Install polipo (with Mac: brew install polipo, with Ubuntu: apt-get install polipo)
  • Drop polipo-start and polipo-console somewhere useful (perhaps $HOME/bin?)
##
# on each backend/non-routable cluster node
#
user_account "adminuser" do
ssh_keygen true
# other attributes perhaps?
end
# put the code in a ruby block so that it gets run in execution phase,
@fnichol
fnichol / .kitchen.yml
Last active February 14, 2018 21:03
Test Kitchen Encrypted Data Bags
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
platforms:
- name: ubuntu-12.04-solo
driver_config:
box: opscode-ubuntu-12.04
provisioner: chef_solo
@fnichol
fnichol / chef-client-zero.rb
Last active December 17, 2015 21:09
Chef Client Zero!
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<[email protected]>)
#
# Copyright (C) 2013, Fletcher Nichol
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@fnichol
fnichol / README.md
Last active December 17, 2015 17:19
Reimplementing Cookbook Resolvers in Test Kitchen 1.0

Berksfile

site :opscode

metadata

cookbook 'apt'
cookbook 'yum'
cookbook 'apache2'
@fnichol
fnichol / log.txt
Created April 26, 2013 19:54
Razor node metadata on Chef Server
$ knife node show web1.razornet.local --medium
Here is my node’s output (note the “razor_metadata” and “razor_attributes” hashes):
root@chef:~# knife node show web1.razornet.local --medium
Node Name: web1.razornet.local
Environment: _default
FQDN: web1.razornet.local
IP: 172.16.33.130
Run List: role[web_server]
Roles: web_server
@fnichol
fnichol / shell.sh
Created April 23, 2013 16:41
Test Kitchen with bats - A Lightning Guide
SUITE_NAME=default
# create a bats subdirectory under your desired suite
mkdir -p test/integration/$SUITE_NAME/bats
# create an initial "canary" bats test file
# more examples at:
# * https://github.com/fnichol/chef-rvm/tree/master/test/integration/rubies/bats
# * https://github.com/fnichol/chef-ruby_build/tree/master/test/integration/alltherubies/bats
# * https://github.com/sstephenson/bats
@fnichol
fnichol / script.sh
Created January 29, 2013 04:44
Subverting An Open Source Project; A Play In Three Acts
git clone [email protected]:fnichol/test-kitchen.git
cd test-kitchen
git remote add jamie [email protected]:jamie-ci/jamie.git
git fetch jamie && git fetch jamie --tags
git checkout --orphan 1.0
git rm -rf .
git merge jamie/master
git push origin 1.0 --tags