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
Use the following to clean up the installation of Chef etc. Primarily because KVM doesn't do snapshots. Sad Panda. | |
sudo /etc/init.d/apache2 stop | |
sudo /etc/init.d/couchdb stop | |
sudo /etc/init.d/chef-client down | |
sudo /etc/init.d/stompserver down | |
sudo /etc/init.d/chef-indexer down | |
sudo aptitude purge -y apache2 apache2.2-common couchdb runit | |
sudo rm -rf /etc/chef /var/chef /etc/apache2 /var/lib/couchdb /etc/sv /etc/service /srv/chef /etc/init.d/chef* /etc/init.d/stompserver | |
gem list | awk '/^[a-z]/ {print $1}' | xargs sudo gem uninstall -aIx |
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
# Apache vhost conf for chef-server 0.6.0 with OSX gem path. | |
<VirtualHost *:443> | |
ServerName chef.localdomain | |
ServerAlias chef | |
DocumentRoot /Library/Ruby/Gems/1.8/gems/chef-server-0.6.0/public | |
Alias /facebox /Library/Ruby/Gems/1.8/gems/chef-server-slice-0.6.0/public/facebox | |
Alias /images /Library/Ruby/Gems/1.8/gems/chef-server-slice-0.6.0/public/images | |
Alias /javascripts /Library/Ruby/Gems/1.8/gems/chef-server-slice-0.6.0/public/javascripts | |
Alias /stylesheets /Library/Ruby/Gems/1.8/gems/chef-server-slice-0.6.0/public/stylesheets |
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/env ruby | |
require 'rubygems' | |
require 'thor' | |
require 'chef' | |
require 'chef/node' | |
require 'chef/rest' | |
# Please see the readme for overview documentation. | |
# |
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
# JSON | |
{ | |
"applications": [ | |
{ | |
"foobar": { | |
"migration_command": "rake db:migrate", | |
"branch": "HEAD", | |
"deploy_action": "deploy", | |
"framework_env": "production", |
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/env ruby | |
# | |
# Throw this into a cron job to notify us when our chef clients | |
# have gone AWOL. | |
# | |
# dave@wegoto12.com | |
# | |
require 'rubygems' | |
require 'chef' | |
require 'ruby-units' |
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
require 'rubygems' | |
require 'json' | |
my_ssh_keys = [ | |
'ssh-rsa blah1', | |
'ssh-rsa blah1' | |
] | |
other_guy_ssh_keys = [ | |
'ssh-rsa blah1' |
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
# | |
# /my_recipe/librairies/shared.rb | |
# | |
class Chef | |
class Recipe | |
# Fill an attribute with given hash | |
def attribute_from_hash(hash) | |
attribute = Mash.new | |
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
sysctl Mash.new unless attribute?("sysctl") |
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
Feature: Mysql | |
In order to have mysql available | |
As a Developer | |
I want to install it | |
Scenario: Mysql Server | |
Given a validated node | |
And it includes the recipe 'mysql::server' | |
When I run the chef-client | |
Then the run should exit '0' |
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
railsdev@db1:~$ sudo gem uninstall mysql && sudo chef-client | |
Successfully uninstalled mysql-2.7 | |
[Fri, 22 May 2009 14:10:31 -0600] INFO: Starting Chef Run | |
[Fri, 22 May 2009 14:10:32 -0600] INFO: Storing updated cookbooks/database/recipes/default.rb in the cache. | |
[Fri, 22 May 2009 14:10:34 -0600] INFO: Installing gem_package[mysql] version 2.7 | |
[Fri, 22 May 2009 14:10:39 -0600] INFO: Ran execute[apt-get-update] successfully | |
[Fri, 22 May 2009 14:10:44 -0600] INFO: Ran execute[create radiant_live database] successfully | |
[Fri, 22 May 2009 14:10:44 -0600] INFO: Chef Run complete in 7.237168 seconds |