Created
April 13, 2010 01:10
-
-
Save benhoskings/364208 to your computer and use it in GitHub Desktop.
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.json.erb | |
------------- | |
// <%= generated_by_babushka %> | |
{ | |
"bootstrap": { | |
"chef": { | |
"url_type": "http", | |
"init_style": "runit", | |
"path": "/srv/chef", | |
"serve_path": "/srv/chef", | |
"server_fqdn": "#{var :server_name}", | |
"webui_enabled": true | |
} | |
}, | |
"run_list": [ "recipe[bootstrap::server]" ] | |
} | |
solo.rb.erb | |
------- | |
# <%= generated_by_babushka %> | |
file_cache_path "/tmp/chef-solo" | |
cookbook_path "/tmp/chef-solo/cookbooks" | |
recipe_url "http://s3.amazonaws.com/chef-solo/bootstrap-latest.tar.gz" | |
chef_admin_vhost.conf.erb | |
--------------- | |
// <%= generated_by_babushka %> | |
location /chef_admin { | |
auth_basic "Restricted"; | |
auth_basic_user_file /etc/nginx/haproxy.users; | |
proxy_pass http://localhost:4040/; | |
} | |
dep 'chef' do | |
requires 'chef gem', 'ohai', 'chef solo', 'chef vhost enabled' | |
end | |
dep 'chef solo' do | |
requires 'chef solo config files' | |
met? { dunno } | |
meet { sudo "chef-solo -c ~/solo.rb -j ~/chef.json" } | |
end | |
dep 'chef solo config files' do | |
helper :files do | |
%w[solo.rb chef.json] | |
end | |
met? { files.all? {|file| babushka_config? "~/#{file}" } } | |
meet { files.each {|file| render_erb "chef/#{file}.erb", :to => "~/#{file}" } } | |
end | |
nginx 'chef vhost enabled' do | |
requires 'vhost configured' | |
set :chef_vhost_link, (var(:nginx_prefix) / "conf/vhosts/on/chef_admin.conf") | |
met? { var(:chef_vhost_link).exists? } | |
meet { sudo "ln -sf '#{var(:chef_vhost_conf)}' '#{var(:chef_vhost_link)}'" } | |
after { restart_nginx } | |
end | |
nginx 'chef vhost configured' do | |
requires 'webserver configured' | |
set :chef_vhost_conf, (var(:nginx_prefix) / "conf/vhosts/chef_admin.conf") | |
met? { var(:chef_vhost_conf).exists? } | |
meet { render_erb "chef/chef_admin_vhost.conf.erb", :to => var(:chef_vhost_conf), :sudo => true } | |
after { restart_nginx if var(:chef_vhost_link).exists? } | |
end | |
gem 'chef gem' do | |
installs 'chef' | |
end | |
gem 'ohai' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment