Skip to content

Loading…

Would like to create the user group with a specific gid #18

Open
tomdz opened this Issue · 3 comments

4 participants

@tomdz

I was hoping to be able to the user and group with specific ids:

user_account "testuser" do
  comment      "Test User"
  uid          9999
  gid          9999
  create_group true
  ssh_keygen   false
end

but this fails with:

[2012-09-28T23:25:59+00:00] DEBUG: Chef::Exceptions::Exec: user_account[testuser] (dummy-service::default line 10) had an error: Chef::Exceptions::Exec: user[testuser] (/tmp/vagrant-chef-1/chef-solo-1/cookbooks/user/providers/account.rb line 94) had an error: Chef::Exceptions::Exec: useradd -c 'Test User' -g '9999' -s '/bin/bash' -u '9999' -m -d '/home/testuser' testuser returned 6, expected 0
---- Begin output of useradd -c 'Test User' -g '9999' -s '/bin/bash' -u '9999' -m -d '/home/testuser' testuser ----
STDOUT: STDERR: useradd: group '9999' does not exist
---- End output of useradd -c 'Test User' -g '9999' -s '/bin/bash' -u '9999' -m -d '/home/testuser' testuser ----
@ForestMars

You have to create the group first.

Also, take note that you have to mange the user's home directory when they are first created-- see http://tickets.opscode.com/browse/CHEF-2409

@nacengineer

Note that there is a group resource to create the group. Thanks for this answer! This works, btw and this issue should be closed! :+1:

@acqant

I don't think we're talking about the same cookbooks. This is not the opscode user cb.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.