[chef] Approaches for managing the Windows local Administrators group


Chronological Thread 
  • From: Arthur Penn < >
  • To: " " < >
  • Subject: [chef] Approaches for managing the Windows local Administrators group
  • Date: Mon, 4 Aug 2014 18:35:33 +0000
  • Accept-language: en-US

I have a base Windows cookbook that uses the group resource in the default recipe to _reset_ the list of local admins based on an attribute value (append false):

 

group "Administrators" do

               action :modify

               members node["winbase"]["admins"]

               append false

end

 

This uses an attribute value set as follows (attributes\default.rb):

 

default["winbase"]["admins"] = ["localadmin", "DOMAIN\\admin1", "DOMAIN\\admin2"]

 

This works well. The issue is that I need to layer on additional administrators in subsequent cookbooks or roles. I’ve tried several things to have a different recipe in a cookbook later in the runlist append two admin users to those identified above but nothing has worked. I am new to Chef and Ruby and probably just don’t understand the situation… but I’d certainly appreciate some insight.

 

Put another way, is there any way to append to the attribute values used in the first recipe via a cookbook later in the runlist? If not, what is the recommended pattern for overriding or (preferably) appending to the set of admin users?

 

Thank you.

 

……………………………………………………………………………………………………………………………………………………………………
Arthur Penn
Samtec New Albany
Office: 812-981-8351   | Fax: 812-981-4359 | +1-800-726-8329
www.samtec.com

 



  • [chef] Approaches for managing the Windows local Administrators group, Arthur Penn, 08/04/2014

Archive powered by MHonArc 2.6.16.

§