My basic point is that currently, configuration management code manifests as a giant, unverifiable pile of mud. The languages we use lack types and are weak at making non-runtime assertions. With the modicum of sanity that a proper module system and types can bring to the table, we would be considerably better off.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Cookbook Name:: collectd_plugins | |
# Recipe:: librato | |
# | |
# Copyright 2012, Sean Escriva <[email protected]> | |
# | |
case node.platform | |
when "ubuntu", "debian" | |
package "libpython2.7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'sensu-handler' | |
require 'socket' | |
class Graphite < Sensu::Handler | |
def send_graphite(metric, msg) | |
host = 'graphite.host.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$hosts_table = { | |
:dbm => "192.168.86.101", | |
:app1 => "192.168.86.102", | |
:app2 => "192.168.86.103", | |
:lb => "192.168.86.104", | |
} | |
def bootstrap(config, host) | |
config.vm.box = "lucid64" | |
config.vm.network $hosts_table[host] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app = node.run_state[:current_app] | |
#unicorn | |
include_recipe "application::unicorn" | |
#nginx | |
include_recipe "nginx::source" | |
#nginx/unicorn proxy | |
socket = "/tmp/unicorn_#{app['id']}.sock" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash -c ' | |
if [ ! -f /usr/bin/chef-client ]; then | |
apt-get update | |
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras | |
cd /tmp | |
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz | |
tar zxf rubygems-1.3.7.tgz | |
cd rubygems-1.3.7 | |
ruby setup.rb --no-format-executable | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This knife.rb orig. provided by [email protected] - but any mistakes are mine! | |
current_dir = File.dirname(__FILE__) | |
platform = "https://api.opscode.com/organizations" | |
require 'grit' | |
branch = Grit::Repo.new("#{current_dir}/..").head.name | |
case branch |