This file contains hidden or 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 bash | |
| TEMPDIR=`mktemp -d puppet-parser.XXXXXX` | |
| test -n "$TEMPDIR" || exit 1 | |
| test -d "$TEMPDIR" || exit 1 | |
| git checkout-index --prefix="$TEMPDIR/" -af | |
| changed_manifests=$(git diff --cached --name-only --diff-filter=ACM | grep '.pp$' | xargs -n 1 -I '{}' echo $TEMPDIR/'{}' | tr '\n' ' ') |
This file contains hidden or 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
| if File::exists?("/sbin/ip") | |
| Facter.add('gateway') do | |
| setcode do | |
| `/sbin/ip route show`.match(/^default.*/)[0].match(/(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/)[0] | |
| end | |
| end | |
| end |
This file contains hidden or 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 'sinatra' | |
| require 'json' | |
| require 'mongoid' | |
| Mongoid.configure do |config| | |
| config.master = Mongo::Connection.new.db('nodes') | |
| config.max_retries_on_connection_failure = 1 | |
| end |
This file contains hidden or 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
| # COLORS | |
| LIGHT_GRAY="\[\033[0;37m\]"; BLUE="\[\033[1;36m\]"; RED="\[\033[0;31m\]"; LIGHT_RED="\[\033[1;31m\]"; | |
| GREEN="\[\033[0;32m\]"; WHITE="\[\033[1;37m\]"; LIGHT_GRAY="\[\033[0;37m\]"; YELLOW="\[\033[1;33m\]"; | |
| # GIT PROMPT (http://gist.github.com/120804) | |
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/'; | |
| } | |
| function parse_git_status { | |
| git status 2> /dev/null | sed -e '/(working directory clean)$/!d' | wc -l; | |
| } |
This file contains hidden or 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
| # /opt/rightscale/sandbox/bin/chef-solo -c /tmp/chef.rb -j /tmp/solo.json | |
| [Fri, 21 Jan 2011 18:32:23 +0000] INFO: Starting Chef Solo Run | |
| [Fri, 21 Jan 2011 18:32:24 +0000] INFO: Replacing the run_list with ["recipe[load_balancer::elb_register]"] from JSON | |
| [Fri, 21 Jan 2011 18:32:24 +0000] WARN: Missing gem 'right_aws' | |
| [Fri, 21 Jan 2011 18:32:25 +0000] INFO: Installing gem_package[fog] version 0.4.0 | |
| [Fri, 21 Jan 2011 18:32:44 +0000] WARN: Mising the 'fog' gem | |
| [Fri, 21 Jan 2011 18:32:44 +0000] ERROR: load_balancer_elb[test-lb] (/opt/rightscale/sandbox/lib/ruby/gems/1.8/gems/chef-0.8.16.3/lib/chef/mixin/recipe_definition_dsl_core.rb line 59) had an error: | |
| uninitialized constant Chef::Provider::LoadBalancerElb::Fog | |
| /root/rightscale_cookbooks/load_balancer/providers/elb.rb:13:in `elb' | |
| /root/rightscale_cookbooks/load_balancer/providers/elb.rb:18:in `class_from_file' |
This file contains hidden or 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 ' | |
| rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm | |
| rpm -Uvh http://download.elff.bravenet.com/5/i386/elff-release-5-3.noarch.rpm | |
| yum install -y ruby ruby-devel gcc gcc-c++ automake autoconf make | |
| wget -O /tmp/rubygems-1.3.7.tgz http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz | |
| tar xzf /tmp/rubygems-1.3.7.tgz -C /tmp | |
| ruby /tmp/rubygems-1.3.7/setup.rb | |
| rm -rf /tmp/rubygems-1.3.7 |
This file contains hidden or 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
| search(:node, "role:#{app_info['prod_role']}").each do |server| | |
| Chef::Log.info("Found a server: #{server} IP: #{server.cloud.private_ips.first}") | |
| server_list << server.cloud.private_ips.first | |
| end | |
| server_list.sort! |
NewerOlder