Create a Windows user with a chef and add the user to the local Administrators group

Chef documentation for user resource: http://docs.getchef.com/resource_user.html

Doing this job:

user "TestUser" do password " p@ssw0rd " end 

But when I add gid, it fails:

 user "TestUser" do password " p@ssw0rd " gid "Administrators" end 

I also tried transmitting. \ Administrator, but I get the same result:

 [2014-08-08T14:00:11-07:00] FATAL: ArgumentError: user[TestUser] (test::users line 11) had an error: ArgumentError: The user does not belong to this group. 

Is the goal of gid not to indicate group membership?

+6
source share
1 answer

I finally figured it out. The trick is to change the group as follows:

 user "TestUser" do password " p@ssw0rd " end group "Administrators" do action :modify members "TestUser" append true end 
+13
source

Source: https://habr.com/ru/post/973571/


All Articles