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
#!/bin/bash | |
# User data to configure a vanilla Ubuntu EC2 instance. | |
# Installs chef-client (with minimal dependencies), | |
# configures chef, and adds roles | |
test $UID == 0 || (echo "Error: must run as root"; exit 1) | |
######### STEP 1: OPERATING SYSTEM CONFIGURATION | |
BOOTLOG="/var/log/bootstrap.log" |
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
#!/bin/bash | |
# User data to configure a vanilla Ubuntu EC2 instance. | |
# Installs chef-client (with minimal dependencies), | |
# configures chef, and adds roles | |
test $UID == 0 || (echo "Error: must run as root"; exit 1) | |
######### STEP 1: OPERATING SYSTEM CONFIGURATION | |
BOOTLOG="/var/log/bootstrap.log" |
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/ruby | |
# | |
# Filter hosts wose time since last checkin >= X | |
# | |
# usage: (process that outputs lines) | filterHosts.rb <#hrs> | |
# to prune hosts in opscode: knife status *:* | filterHosts.rb <#hrs> | xargs -I % knife node delete % -y | |
STDIN.each_line {|line| | |
#split the line by commas, strip whitespace, map to fields |
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
# Set attribute indicating munin role | |
node.set["munin"]["node"] = true | |
# Find available munin servers | |
available_servers = search(:node, "munin_server:true") | |
# Install munin plugins | |
munin_plugin "passenger_memory_stats" | |
munin_plugin "passenger_status" |
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
node[:apt][:repo].each do |repo| | |
apt_repository repo[:name] | |
uri repo[:uri] | |
distribution repo[:dist] | |
components repo[:component] | |
action :add | |
end | |
end |
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
domU-12-31-39-13-D8-C1% rsyslogd -v | |
rsyslogd 5.6.2, compiled with: | |
FEATURE_REGEXP: Yes | |
FEATURE_LARGEFILE: No | |
FEATURE_NETZIP (message compression): Yes | |
GSSAPI Kerberos 5 support: No | |
FEATURE_DEBUG (debug build, slow code): No | |
Atomic operations supported: Yes | |
Runtime Instrumentation (slow code): No |
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 jtimberman@opscode.com - 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 |
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
######################################################################## | |
### NOTICE: this file managed by chef; changes made here will be lost. | |
######################################################################## | |
# ubuntu defaults, left here for compatibility | |
root ALL=(ALL) ALL | |
%admin ALL=(ALL) NOPASSWD:ALL | |
# Amazon EC2 ubuntu user - DO NOT REMOVE FROM EC2 NODES | |
# ubuntu user is default user in ec2-images. |
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
jzimmerman@ip-10-117-53-160:/etc/rsyslog.d$ sudo chef-client | |
[Wed, 26 Jan 2011 23:03:30 +0000] INFO: Starting Chef Run (Version 0.9.12) | |
[Wed, 26 Jan 2011 23:03:32 +0000] INFO: Writing updated content for template[/etc/rsyslog.d/nginx-main-error.conf] to /etc/rsyslog.d/nginx-main-error.conf | |
[Wed, 26 Jan 2011 23:03:32 +0000] INFO: template[/etc/rsyslog.d/nginx-main-error.conf] sending reload action to service[rsyslog] (delayed) | |
[Wed, 26 Jan 2011 23:03:32 +0000] ERROR: Running exception handlers | |
[Wed, 26 Jan 2011 23:03:32 +0000] ERROR: Exception handlers complete | |
/usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:53:in `run_action': undefined method `run_action' for "service[rsyslog]":String (NoMethodError) | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:101:in `converge' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:97:in `each' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.12/bin/../lib/chef/runner.rb:97:in `converge' |
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
# from rsyslog::default.rb: | |
service "rsyslog" do | |
supports :restart => true, :reload => true | |
action [:enable, :start] | |
end | |
# from rsyslog/providers/imfile.rb: |