Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott M. Likens damm

  • Seattle, Washington USA
View GitHub Profile
View gist:158582
mayo:~ sudo virsh dumpxml chefserver
Connecting to uri: qemu:///system
<domain type='kvm' id='20'>
<name>chefserver</name>
<uuid>e13f3fac-1a96-253c-2e46-4597ce2c9e44</uuid>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
View gist:186246
ruby_block "something" do
block do
require 'expect'
require 'pty'
PTY.spawn( 'dnscache-setup' ) do |read,write,pid|
write.sync = true
$expect_verbose = false
read.expect( '(press enter to begin setup, or press control-C to abort)', 30 ) do |response|
View test.rb
if Gem.const_get "RubyGemsVersion" < "1.3.5"
%w{
rubygems
rubygems-doc
rubygems1.8
rubygems1.9
}.each do |p|
apt_package(p) { action :purge }
end
View default.rb
#
# Cookbook Name:: users
# Recipe:: default
#
# Copyright 2009, Opscode, Inc
package "libshadow-ruby1.8"
group "sysadmin" do
gid 4242
View proxy.cfg.erb
<%- @app_servers.each do |app| %>
server <%= app['hostname'] %> <%= app['ipaddress'] %>:80
<%- end %>
View chef.json
[root@zserver chef]# cat chef.json
{
"bootstrap": {
"chef": {
"url_type": "http",
"init_style": "init",
"path": "/opt/chef",
"serve_path": "/opt/chef",
"server_fqdn": "zserver.stompy.lan"
}
View config.ru
require 'merb-core'
require 'chef'
Chef::Config.from_file('/etc/chef/server.rb')
require 'chef/nanite'
require 'uuidtools'
Chef::Config[:nanite_identity] = "chef-#{UUIDTools::UUID.random_create.to_s}"
Chef::Nanite.in_event { Chef::Log.info "Nanite Booting..." }
time = 17
View chef.json
{
"bootstrap": {
"chef": {
"url_type": "http",
"init_style": "init",
"server_fqdn": "ec2-174-129-61-113.compute-1.amazonaws.com",
},
"recipes": "bootstrap::client"
}
}