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
| hostlist=("http://chef.rckspc.com" "http://s3.amazonaws.com") | |
| # Get command line arguments | |
| while getopts sarv: opt | |
| do | |
| case "$opt" in | |
| v) version="$OPTARG";; | |
| s) use_shell=1;; | |
| a) test -n "$host" && echo "Host already set to ${host}" || host="${hostlist[1]}";; | |
| r) test -n "$host" && echo "Host already set to ${host}" || host="${hostlist[0]}";; |
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
| Creating debian-6.0.1-i686/chef-full-0.10.10-1-debian-6.0.1-i686.sh on Cloud Files | |
| Traceback (most recent call last): | |
| File "shearline.py", line 21, in <module> | |
| cf_object.send(item) | |
| File "/Library/Python/2.7/site-packages/cloudfiles/utils.py", line 45, in decorator | |
| return f(*args, **kwargs) | |
| File "/Library/Python/2.7/site-packages/cloudfiles/storage_object.py", line 509, in send | |
| http.send(chunk) | |
| File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 773, in send | |
| self.sock.sendall(data) |
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
| from pychef import Node | |
| n = Node.init("foo") | |
| n["mysql"]["tunable"]["key_buffer_size"] = "64M" | |
| # or | |
| attributes = { "mysql" : { "tunable" : { "key_buffer_size" : "64M" } } } | |
| n.add_override(attributes) | |
| run_list = "role[bigrole], recipe[chef-client::service]" |
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
| default[:username][:password] = nil |
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
| default[:kernel][:newinstall] = "default" |
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
| execute "yum check-update" do | |
| action :nothing | |
| end | |
| template "/etc/yum.repos.d/cloudkick.repo" do | |
| mode "0644" | |
| source "cloudkick.repo.erb" | |
| notifies :run, resources(:execute => "yum check-update"), :immediately | |
| 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 'chef/provider/package/apt' | |
| class Chef | |
| class Provider | |
| class Package | |
| class Apt | |
| class Safe < Chef::Provider::Package::Apt | |
| def install_package(name, version) | |
| Rackspace::Locks.wait_on_lock(new_resource.timeout) | |
| run_command_with_systems_locale( |
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 'fcntl' | |
| class File | |
| def flocked? &block | |
| flockstruct = [Fcntl::F_RDLCK, 0, 0, 0, 0].pack("ssqqi") | |
| fcntl Fcntl::F_GETLK, flockstruct | |
| status = flockstruct.unpack("ssqqi")[0] | |
| case status | |
| when Fcntl::F_UNLCK | |
| return false |
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
| class File | |
| def flocked? &block | |
| status = flock LOCK_EX|LOCK_NB | |
| case status | |
| when false | |
| return true | |
| when 0 | |
| begin | |
| block ? block.call : false | |
| ensure |
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
| begin | |
| require 'sys/proctable' | |
| rescue LoadError | |
| Chef::Log.warn("Missing gem 'sys-proctable'") | |
| end | |
| require 'timeout' | |
| module Rackspace | |
| def self.getProcPid(name) |