Created
August 14, 2009 00:57
-
-
Save kevn/167562 to your computer and use it in GitHub Desktop.
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
# File: roles/common.rb | |
name "common" | |
description "Applied to all servers" | |
recipes "users" | |
default_attributes( | |
:groups => { | |
:admins => {:gid => 900}, | |
}, | |
:users => { | |
:kevn => { :password => "*", :comment => "Kevin", :uid => 1001, :group => :admins }, | |
:bob => { :password => "*", :comment => "Bob", :uid => 1002, :group => :admins }, | |
:joe => { :password => "*", :comment => "Joe", :uid => 1003, :group => :admins }, | |
:al => { :password => "*", :comment => "Al", :uid => 1004, :group => :admins }, | |
}, | |
) | |
# File: roles/app.rb | |
name "app" | |
description "App server" | |
recipes "merb_site" # Also tried adding "users" here | |
default_attributes( | |
:groups => { | |
:app => {:gid => 800}, | |
}, | |
:users => { | |
:app => { :password => "*", :comment => "App User", :uid => 800, :group => :app } | |
} | |
) | |
# File: /etc/chef/node.json | |
{ | |
"run_list": [ "role[common]", "role[app]" ] | |
} | |
# File: site-cookbooks/users/recipes/default.rb | |
raise [node.groups.keys, node.users.keys].inspect | |
# Results of the raise in the cookbook: [["app"], ["joe", "bob", "kevn", "al"]] | |
# But I would expect: [["admins", "app"], ["joe", "bob", "kevn", "al", "app"]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment