Great Book (Free Online) : [http://www.braveclojure.com/](Brave Clojure)
Note: total experiment and hack, looks nasty, could be awesome:
- 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
andpolipo-console
somewhere useful (perhaps$HOME/bin
?)
This file contains hidden or 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 'chef/knife' | |
Chef::Config.from_file(File.join(Chef::Knife.chef_config_dir, 'knife.rb')) | |
rest = Chef::REST.new(Chef::Config[:chef_server_url]) | |
Chef::Node.list.each do |node| | |
%w{read update delete grant}.each do |perm| |
This file contains hidden or 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
ruby_block "sync_build_from_s3" do | |
action :nothing | |
block do | |
# latest_file contains path to the latest.txt, which lists files to sync | |
file = File.new(latest_file, "r"); | |
run_context = Chef::RunContext.new(node, {}) | |
# | |
# Create the directory to hold the new build files | |
# |
This file contains hidden or 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
ruby_block "configure #{p} module" do | |
block do | |
require 'chef/util/file_edit' | |
nc = Chef::Util::FileEdit.new("/etc/reconnoiter/noit.conf") | |
nc.insert_line_after_match(/lua.*noit.module.smtp/, "<module loader=\"lua\" name=\"#{p}\" object=\"noit.module.#{p}\"/>") | |
nc.write_file | |
Chef::Log.info "Inserted module config for #{p}" | |
end |