Last active
December 16, 2015 13:48
-
-
Save fabrikagency/5444026 to your computer and use it in GitHub Desktop.
Knife Solo Setup on Rackspace Cloud
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
site :opscode | |
cookbook 'redisio' | |
cookbook 'git' | |
cookbook 'apt' | |
cookbook "runit", ">= 1.1.2" # HACK: force-use this version to use restart_on_update | |
cookbook 'rackbox' | |
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
source 'http://rubygems.org' | |
gem 'berkshelf' | |
gem 'knife-solo' | |
gem 'knife-rackspace' |
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
# chef-repo/.chef/knife.rb | |
log_level :info | |
log_location STDOUT | |
node_name 'solo' | |
client_key File.expand_path('../solo.pem', __FILE__) | |
cache_type 'BasicFile' | |
cache_options( :path => File.expand_path('../checksums', __FILE__)) | |
cookbook_path [ File.expand_path('../cookbooks', __FILE__) ] | |
knife[:rackspace_api_username] = "" | |
knife[:rackspace_api_key] = "" | |
knife[:rackspace_auth_url] = "https://ord.servers.api.rackspacecloud.com/v2" | |
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
{ | |
"run_list":[ | |
"rackbox" | |
], | |
"appbox": { | |
"apps_dir":"/srv" | |
}, | |
"databox": { | |
}, | |
"rackbox": { | |
"ruby": { | |
"versions": ["1.9.3-p392"], | |
"global_version": "1.9.3-p392" | |
}, | |
"apps": { | |
"unicorn": [ | |
{ "appname": "my-app.com", | |
"hostname": "u1.my-app.com" | |
} | |
] | |
} | |
} | |
} | |
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
http://teohm.github.io/blog/2013/04/17/chef-cookbooks-for-busy-ruby-developers/ | |
mkdir -p /my/app/chef-repo/.chef | |
cd /my/app/chef-repo | |
ssh-keygen -f .chef/solo.pem | |
berks install -p cookbooks | |
knife solo prepare sshalias | |
If you get this - | |
rbenv: cannot rehash: /opt/rbenv/shims isn't writable | |
Run this on the server - | |
rbenv --debug rehash | |
knife cookbook create app -o cookbooks | |
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
# chef-repo/solo.rb | |
file_cache_path "/tmp/chef-solo" | |
data_bag_path "/tmp/chef-solo/data_bags" | |
encrypted_data_bag_secret "/tmp/chef-solo/data_bag_key" | |
cookbook_path [ "/tmp/chef-solo/site-cookbooks", | |
"/tmp/chef-solo/cookbooks" ] | |
role_path "/tmp/chef-solo/roles" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment