How do I manage code that *removes* users in chef?

0 votes

 I am not sure of how to effectively manage the codebase when it comes to removing them. Say I have a user resource:

user 'jane' do
  action :create
end

This will create Jane's user, but what if Jane leaves the company? If I understand how the resource works, I can't just remove these lines from the recipe - I'd have to change the block to:

user 'jane' do
  action :remove
end

 It seems like I'd have to remember to go in and change this block, then go in and remove this code once the recipe has been used on all relevant nodes, since once the user is gone the code isn't doing anything.

What's more, if I have a loop like this:

node['users'].each do |name|
  user name do 
    action :create
  end
end

I would have to split individual users' names out of the attribute and add their own block to the recipe to remove them, then remember to remove that block once all nodes have converged.

Is there any other way which is better to manage user resources?

Can anyone help me with this query?

Thanks

Aug 6, 2018 in DevOps Tools by shubham
• 6,500 points
18 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

No, I don't think this will prove to be sustainable eventually. Any place big enough to worry about user turnover should already have switched to LDAP for centralized user management. LDAP is the best option we have still now. Usually this also goes hand-in-hand with an Active Directory server for other things and gets used on the side for Unix user management.

I hope the above explanation will help you resolve your query.

Thanks.

answered Aug 6, 2018 by Damon Salvatore
• 5,270 points

Related Questions In DevOps Tools

+1 vote
3 answers

How do I check and export sonarqube analysis reports in embedded db?

Browse to sonarqube web instance to access ...READ MORE

answered Jul 2, 2018 in DevOps Tools by DareDev
• 6,560 points
1,514 views
0 votes
1 answer

How do I run “ant update” in Hybris with only “Update Running System”?

Here is what you can try. You can ...READ MORE

answered Jul 10, 2018 in DevOps Tools by Atul
• 10,200 points
779 views
0 votes
1 answer

How do I find OpsWorks deploy user in a recipe ?

Here is a concept which you can ...READ MORE

answered Jul 25, 2018 in DevOps Tools by Atul
• 10,200 points
22 views
0 votes
1 answer

For Gradle & Spring Boot, how do I choose dependency with implementation?

Below is the answer to your question: Both ...READ MORE

answered Jun 16, 2018 in DevOps Tools by shubham
• 6,500 points
46 views
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

How do I set maximum queue connection for nginx port in Windows?

Since increasing queue size did not fix your problem ...READ MORE

answered Aug 22, 2018 in DevOps Tools by Damon Salvatore
• 5,270 points
40 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.