Chef documentation for the user resource: http://docs.getchef.com/resource_user.html
Doing this works:
user "TestUser" do
password "p@ssw0rd"
end
But when I add a gid it fails:
user "TestUser" do
password "p@ssw0rd"
gid "Administrators"
end
I've also tried passing .\Administrator, but 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 purpose of gid not to specify group membership?
Eventually figured it out. The trick is to modify the group like so:
user "TestUser" do
password "p@ssw0rd"
end
group "Administrators" do
action :modify
members "TestUser"
append true
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With