sous-chefs / users

Development repository for the users cookbook
https://supermarket.chef.io/cookbooks/users
Apache License 2.0
138 stars 217 forks source link

Fix ssh_keys template 'group cannot be determined' error #70

Closed gsaslis closed 9 years ago

gsaslis commented 9 years ago

As discussed on https://github.com/opscode-cookbooks/users/issues/64 , I had some trouble using the 'ssh_keys' attribute when using the users cookbook...

When my user.json did NOT include a 'gid' attribute, I was getting an error:

template[/home/giorgos/.ssh/authorized_keys] (/tmp/vagrant-chef-3/chef-solo-1/cookbooks/users/providers/manage.rb line 121) had an error: Chef::Exceptions::GroupIDNotFound: cannot determine group id for 'giorgos', does the group exist on this system?

(https://github.com/opscode-cookbooks/users/blob/master/providers/manage.rb#L121)

The template resource was not able to find the group id... So, I tried including a 'gid' attribute, only this time:

==> default: Chef::Exceptions::User
==> default: ----------------------
==> default: user[giorgos] (/tmp/vagrant-chef-3/chef-solo-1/cookbooks/users/providers/manage.rb line 94) had an error: Chef::Exceptions::User: Couldn't lookup integer GID for group name 7000

...leaving me no choice but to change the source code... (This is all on an OpenSUSE 13.1 VM, so it might work on other OS)

gsaslis commented 9 years ago

indentation should be fixed. sorry about that...

supergrilo commented 9 years ago

Why this does not merged? how do you solve?

I have the same problem... :/

Error executing action `create` on resource 'template[/home/user/.ssh/authorized_keys]'
gsaslis commented 9 years ago

@supergrilo sorry for the delayed reply... I basically ended up using my own fork, with the patched code that creates the group using the group resource, before using it... at the moment my commit was very opensuse - specific, however I am happy to give this another go, now that I am (much) more familiar with Chef, if you are still having problems...

gsaslis commented 9 years ago

closed this, in favour of #96