Skip to content

Instantly share code, notes, and snippets.

View jordandm's full-sized avatar

Jordan Dea-Mattson jordandm

  • DevOpsPM
  • Singapore
View GitHub Profile
@jordandm
jordandm / amazon-linux-gems-19.erb
Created April 5, 2012 03:16
Chef Amazon Linux Boostrap File for Ruby 1.9.3 on AmazonLinux 2012.03
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
if [ ! -f /usr/bin/chef-client ]; then
yum groupinstall -y 'Development tools'
yum install -y libxml2-devel libxslt-devel
yum install -y ruby19 ruby19-devel rubygems19 rubygem19-rdoc rubygem19-rake rubygem19-bigdecimal
ln -sf /usr/bin/ruby1.9 /usr/bin/ruby
ln -sf /usr/bin/gem1.9 /usr/bin/gem
ln -sf /usr/bin/irb1.9 /usr/bin/irb
@jordandm
jordandm / gist:2307245
Created April 5, 2012 01:38
Tagging Error
********** Stack trace:
[Thu, 05 Apr 2012 01:32:51 +0000] INFO: Processing log[instance_tag - i-019b6c66 has ec2 attribute] action write (worker::instance_tag line 36)
[Thu, 05 Apr 2012 01:32:51 +0000] INFO: instance_tag - i-019b6c66 has ec2 attribute
[Thu, 05 Apr 2012 01:32:51 +0000] INFO: Processing log[instance_tag - i-019b6c66 has ec2 instance_id i-019b6c66] action write (worker::instance_tag line 42)
[Thu, 05 Apr 2012 01:32:51 +0000] INFO: instance_tag - i-019b6c66 has ec2 instance_id i-019b6c66
[Thu, 05 Apr 2012 01:32:51 +0000] INFO: Processing AmazonEC2Tag_ec2tag[index] action create (worker::instance_tag line 47)
[Thu, 05 Apr 2012 01:32:51 +0000] ERROR: Running exception handlers
[Thu, 05 Apr 2012 01:32:52 +0000] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[Thu, 05 Apr 2012 01:32:52 +0000] ERROR: Exception handlers complete
[Thu, 05 Apr 2012 01:32:52 +0000] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
@jordandm
jordandm / gist:2307188
Created April 5, 2012 01:27
Revised template...
<% @domains.each do |domain, items| %>
<% items.each do |item, types | %>
<% types.each do |type, value| %>
<%= "#{domain}".ljust(16) %> <%= "#{type}".ljust(8) %><%= "#{item}".ljust(16) %><%= "#{value}" %>
<% end -%>
<% end -%>
<% end -%>
@jordandm
jordandm / gist:2307145
Created April 5, 2012 01:18
hef::Mixin::Template::TemplateError: undefined method `each' for "65536":String
The recipe:
# Cookbook Name:: worker
# Recipe:: instance-tuning
#
# Copyright 2012, Numenta, Inc.
#
# All rights reserved - Do Not Redistribute
#
limits = data_bag_item('limits', 'worker')
@jordandm
jordandm / gist:1995090
Created March 7, 2012 18:51
Example Knife Bootstrap Command
knife ec2 server create -r 'role[data-service]' -I ami-8e1fece7 -f m1.large -d amazon-linux-gems -G "web-dev" -i ~/.ssh/chef-knife.pem -S chef-knife --ssh-user ec2-user --region us-east-1 -Z us-east-1d -VV
@jordandm
jordandm / gist:1995080
Created March 7, 2012 18:49
Amazon Linux AMI
bash -c '
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%>
if [ ! -f /usr/bin/chef-client ]; then
yum install -y ruby ruby-devel gcc gcc-c++ automake autoconf make
yum install -y rubygems
fi
gem update --system
gem update
@jordandm
jordandm / gist:1879612
Created February 21, 2012 22:53
Revised side-wise install recipe
#
# Cookbook Name:: awsclient
#
include_recipe "aws"
# Removing dependency on api, do not believe it is required.
# include_recipe "apt"
#Install all depdencies for fog gems on ubuntu
@jordandm
jordandm / gist:1879573
Created February 21, 2012 22:46
yum install of libxml-devel and libxslt-devel on broken node
$ sudo yum install libxml2-devel
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
amzn-main | 2.1 kB 00:00
amzn-updates | 2.3 kB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libxml2-devel.x86_64 0:2.7.6-4.11.amzn1 set to be updated
--> Processing Dependency: pkgconfig for package: libxml2-devel-2.7.6-4.11.amzn1.x86_64
@jordandm
jordandm / gist:1879556
Created February 21, 2012 22:44
Cookbook on system
#
# Cookbook Name:: awsclient
#
include_recipe "aws"
# Removing dependency on api, do not believe it is required.
# include_recipe "apt"
#Install all depdencies for fog gems on ubuntu
@jordandm
jordandm / gist:1879540
Created February 21, 2012 22:41
Full first run log
DEBUG: Using configuration from /Users/jdeamattson/repos/chef-repo/.chef/knife.rb
Instance ID: i-7081bb15
Flavor: m1.large
Image: ami-8e1fece7
Region: us-east-1
Availability Zone: us-east-1d
Security Groups: hypersearch-dev
SSH Key: chef-knife
Waiting for server...................