[chef] Re: How can I add/delete temporary users?


Chronological Thread 
  • From: Nathen Harvey < >
  • To:
  • Subject: [chef] Re: How can I add/delete temporary users?
  • Date: Tue, 29 Nov 2011 17:16:59 -0500

We use a databag for each user with a disabled attribute and then lock / unlock the account based on that attribute's value.

  user u['id'] do
    if u['disabled'] then
      action :lock
    else
      action :unlock
    end
  end


-- 
Nathen Harvey

On Tuesday, November 29, 2011 at 4:49 PM, wrote:

I'm using the users cookbook to create users and distribute ssh keys. I've now
been tasked with automating the creation/deletion of users who only need
temporary access to servers. For example when a developer is needed to assist
with issues on a production server. For auditing purposes we're wanting to
drive it via Git -> Chef. I'm thinking I could search for local users within a
UID range, compare that with what Chef expects and delete accounts for those
that shouldn't be there.

Has anyone solved this or similar scenarios?




Archive powered by MHonArc 2.6.16.

§