- From: Noah Kantrowitz <
>
- To:
- Subject: [chef] Re: Re: RE: Re: Creating local users
- Date: Thu, 30 Jul 2015 09:35:14 -0700
https://github.com/poise/poise-service#poise_service_user is an easy way to
handle this.
--Noah
On Jul 30, 2015, at 9:31 AM, Fabien Delpierre
<
>
wrote:
>
You could put your users in different groups, and then use the users
>
cookbook's users_manage resource to look for users in a given group and
>
only create those users on a given node.
>
>
On Thu, Jul 30, 2015 at 12:05 PM, Mohammad Fattahian
>
<
>
>
wrote:
>
Thanks for your help, but as I said I’m using ‘users cookbook’
>
(https://github.com/opscode-cookbooks/users)
>
>
>
I’ve created a databag with all users we need on the nodes, but some nodes
>
does not require all the users created. I’m looking for a way to create
>
users based nodes.
>
>
>
Mohammad
>
>
>
>
>
From: Yoshi Spendiff
>
[mailto:
>
>
Sent: Thursday, July 30, 2015 11:16 AM
>
To: chef
>
Subject: [chef] Re: Creating local users
>
>
>
I have a base cookbook with a users recipe that I apply to all nodes.
>
>
It looks something like this:
>
>
node['base-cookbook']['users'].each do |username, enabled|
>
>
user username do
>
>
action enabled ? :create : :remove
>
>
<other user options>
>
>
end
>
>
end
>
>
Then in your roles or role cookbook you can just use that attribute.
>
>
default['base-cookbook']['users']['user_1'] = true
>
default['base-cookbook']['users']['user_2'] = true
>
default['base-cookbook']['users']['user_3'] = false
>
>
I use a hash instead of an array so you can delete a user and so you don't
>
come across any situations where you were expecting to overwrite an array
>
and instead it was merged.
>
>
>
On Thu, Jul 30, 2015 at 7:15 AM, Mohammad Fattahian
>
<
>
>
wrote:
>
>
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
>
>
>
>
>
--
>
>
Yoshi Spendiff
>
>
Ops Engineer
>
>
Indochino
>
>
Mobile: +1 778 952 2025
>
>
Email:
>
>
>
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
Archive powered by MHonArc 2.6.16.