I create a users data bag for each role (admittedly, this gets a bit redundant, since some users are in multiple roles) and then set the default[‘users’][‘databag’] attribute in the role cookbook. If you don’t use role cookbooks, you could set the data bag as an override attribute in the role. I also set the groups based on role with a default[‘users’][‘groups’] attribute, so I run my users_manage resource like so: include_recipe "users" node['users']['groups'].each do |grp| users_manage grp do data_bag node['users']['data_bag'] action [ :remove, :create ] end end --fitz From: Mohammad Fattahian [mailto:
Hi folks, What’s the best way to create local users based on the role of the nodes? Let say I need different users created on nodes based on their roles (WEB Server, DB Server, etc.) I’m using ‘users Cookbook’ to create users from a database. Mohammad |
Archive powered by MHonArc 2.6.16.