Skip to content

Instantly share code, notes, and snippets.

@deepak
Created December 6, 2012 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepak/4222393 to your computer and use it in GitHub Desktop.
Save deepak/4222393 to your computer and use it in GitHub Desktop.
name "basebox"
description "A basic box with some packages, ruby and rbenv installed"
deploy_user = ENV['CHEF_DEPLOY_USER']
# puts "== deploy user is: #{deploy_user.inspect}"
# cannot access node attributes in roles. will have to use
# chef-server's search as in http://wiki.opscode.com/display/chef/Search#Search-FindNodeswithaRoleintheExpandedRunList
# but i want to use chef-solo not chef-server and cannot use search
# deployer_user = node['users']['names'].find {|k,v| v['role'] == "deploy" }
override_attributes {
{"rbenv" => {
"group_users" => [deploy_user]
}
}
}
run_list [
#"recipe[users]",
#"recipe[packages]",
"recipe[nginx]",
#"recipe[ruby]"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment