Andrew Johnstone ajohnstone

View working_logstash_syslog.rb
1 2 3 4 5 6 7 8 9 10
# This file was created for i-55aef515
# by Chef
# Manual changes will be lost
input {
 
file {
'path' => ['/var/log/syslog', '/var/log/messages']
'start_position' => 'beginning'
'type' => 'syslog'
}
View gist:9135591

DNS

IMPORTANT! - The naming conventions are important to the creating DNS records. The DNS records are to be largely scripted.

Naming

Instance IDs

Amazon instance ids are in the form "i-2227656c".

View full.rb
1 2 3 4 5 6 7 8 9
[2014-02-15T23:47:34-02:00] DEBUG: Platform is ubuntu version 12.04
[2014-02-15T23:47:34-02:00] INFO: Run List is [role[base], recipe[mysql::client], recipe[mysql::ruby], recipe[tomcat::tomcat_proxy], recipe[application::cms]]
[2014-02-15T23:47:34-02:00] INFO: Run List expands to [apt, initial_setup, sudo::chefclient, deployment::client, logstash::agent, motd-tail, monit, collectd, ruby, users, users::sysadmins, mysql::client, mysql::ruby, tomcat::tomcat_proxy, application::cms]
[2014-02-15T23:47:34-02:00] INFO: Starting Chef Run for cms
[2014-02-15T23:47:34-02:00] INFO: Running start handlers
[2014-02-15T23:47:34-02:00] INFO: Start handlers complete.
[2014-02-15T23:47:34-02:00] DEBUG: No chefignore file found at /tmp/vagrant-chef-1/chef-solo-1/cookbooks/chefignore no files will be ignored
[2014-02-15T23:47:34-02:00] DEBUG: Loading cookbook logrotate's library file: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/logrotate/libraries/logrotate_config.rb
[2014-02-15T23:47:34-02:00] DEBUG: Loading cookbook openssl's l
View out.rb
1 2 3 4 5 6 7
[2014-02-15T23:47:35-02:00] DEBUG: Found recipe default in cookbook yum
[2014-02-15T23:47:35-02:00] DEBUG: filtered backtrace of compile error: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/recipes/default.rb:26:in `from_file',/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/recipes/default.rb:19:in `from_file',/tmp/vagrant-chef-1/chef-solo-1/cookbooks/logstash/recipes/agent.rb:9:in `from_file'
[2014-02-15T23:47:35-02:00] DEBUG: filtered backtrace of compile error: /tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/recipes/default.rb:26:in `from_file',/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/recipes/default.rb:19:in `from_file',/tmp/vagrant-chef-1/chef-solo-1/cookbooks/logstash/recipes/agent.rb:9:in `from_file'
[2014-02-15T23:47:35-02:00] DEBUG: backtrace entry for compile error: '/tmp/vagrant-chef-1/chef-solo-1/cookbooks/yum/recipes/default.rb:26:in `from_file''
[2014-02-15T23:47:35-02:00] DEBUG: Line number of compile error: '26'
 
================================================================================
View gist:7633212
1 2 3 4 5 6 7 8 9 10
check process pm2 MATCHING "pm2: Satan Daemonizer"
group pm2
start program = "/etc/init.d/pm2-init.sh start"
stop program = "/etc/init.d/pm2-init.sh stop"
if 3 restarts within 5 cycles then timeout
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 500 MB for 5 cycles then alert
if children < 2 then alert
every 2 cycles
View gist:7485573
1 2 3 4 5 6 7 8 9 10
andrew@andrew-OptiPlex-7010-lxc:/var/www/tmp/tmp/babel/handsfree/scripts$ ./launch_instance_from_ami.sh
Running: /opt/ec2-api-tools/bin/ec2-run-instances ami-edc6fe99 -t m1.medium -n 1 -g pod -k photobox-eu
Instance ids are:
i-72ba6a3d
Running: /opt/ec2-api-tools/bin/ec2-create-tags -t Name=andrew i-72ba6a3d -t Stack=live -t Project=montgolfier -t Department=webteam -t Owner=andrew
Instances tagged successfully
Fetching Public DNS name...
 
AMI ami-872bc6f0 ready
addr:10.49.121.110
View mysqlmem
1 2 3 4 5 6 7 8 9
# MySQL Service
 
description "MySQL Server"
author "Mario Limonciello <superm1@ubuntu.com>"
 
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [016]
View gist:7154812
1 2 3 4 5 6 7 8 9
# -*- mode: ruby -*-
# vi: set ft=ruby :
 
#
#
# Author:: Andrew Johnstone (mailto:andrew.johnstone@photobox.com)
 
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
View gist:7136882
1 2 3 4 5 6 7 8 9 10
# -*- mode: ruby -*-
# vi: set ft=ruby :
 
Vagrant::Config.run do |config|
config.vm.box = "ubuntu_server_12_10_amd64"
config.vm.box_url = 'http://goo.gl/8kWkm'
 
nodes = {
'esb' => {
:hostname => '01-esb.photobox.com',
View gist:6719444
1 2 3 4 5 6 7 8 9 10
{ [Error: Cannot find module './DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
announcements-babel-service listening at http://0.0.0.0:18001
 
/mnt/srv/www/services/releases/20130819185230/app/member.js:148
result.member.fields.prefs_hash.stores[brand].stores.push({stor
^
TypeError: Cannot call method 'push' of undefined
at store.add (/mnt/srv/www/services/releases/20130819185230/app/member.js:148:74)
at Object.store.filterX (/mnt/srv/www/services/releases/20130819185230/app/member.js:100:13)
at store.fetch (/mnt/srv/www/services/releases/20130819185230/app/member.js:61:22)
Something went wrong with that request. Please try again.