[chef] RE: Creating local users


Chronological Thread 
  • From: "Fitzwater, Brian K (CTR)" < >
  • To: " " < >
  • Subject: [chef] RE: Creating local users
  • Date: Thu, 30 Jul 2015 16:44:47 +0000
  • Accept-language: en-US
  • Authentication-results: spf=none (sender IP is 216.81.82.137) smtp.mailfrom=uscis.dhs.gov; lists.opscode.com; dkim=none (message not signed) header.d=none;
  • Dm2pr09mb0764: X-MS-Exchange-Organization-RulesExecuted

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:
Sent: Thursday, July 30, 2015 10:16 AM
To:
Subject: [chef] Creating local users

 

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.

§