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
### Ensure variables are declared | |
[[ -z "$RUBY_VERSION" ]] && printf ">>> RUBY_VERSION must be set.\n" && exit 10 | |
[[ -z "$RUBY_HOME" ]] && printf ">>> RUBY_HOME must be set.\n" && exit 11 | |
### Install Packages | |
set -x |
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 | |
#^syntax detection | |
site 'http://community.opscode.com/api/v1' | |
cookbook 'ruby_build', |
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
{ | |
"id": "my_app", | |
"server_roles": [ | |
"my_app" | |
], | |
"type": { | |
"my_app": [ | |
"rails", | |
"unicorn" |
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 'debsfromrepos' | |
require 'chef/config' | |
require 'chef/data_bag' | |
Chef::Config.from_file('./.chef/knife.rb') | |
data_bag = 'sources_list' |
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 | |
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib")) | |
require 'rubygems' | |
require 'thor' | |
require 'chef' | |
require 'chef/node' | |
require 'chef/role' | |
require 'chef/data_bag' |
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
cluster_type = 'Grover' | |
differentiator = 'test' | |
# cluster_name = "#{cluster_type}_#{differentiator}" | |
cluster_name = "Grover" | |
require "Chef" | |
data = Chef::DataBagItem.load('cluster_template_values', cluster_type)['default'] | |
ClusterChef.cluster cluster_name do | |
recipe "tuning" |
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 | |
NODENAME="%farm_name%-%friendly_name%-%instance_id%" | |
LOG=/var/log/chef-bootstrap.log | |
DIRECTORY=/etc/chef | |
CLIENT_RB=$DIRECTORY/client.rb | |
CHEF_JSON=$DIRECTORY/chef.default.json | |
PRIVATE_KEY=$HOME/.ssh/id_rsa | |
PUBLIC_KEY=$PRIVATE_KEY.pub | |
function say_start { |
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
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |
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 "chef/config" | |
require "chef/knife" | |
require "chef/log" | |
require "chef/mixin/convert_to_class_name" | |
module DataBagCommon | |
def self.included(base) | |
base.module_eval do | |
def read_secret |
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
bash -c ' | |
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
if [ ! -f /usr/bin/chef-client ]; then | |
apt-get update | |
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras | |
cd /tmp | |
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz | |
tar zxf rubygems-1.6.2.tgz | |
cd rubygems-1.6.2 |
NewerOlder