# Manage uids and gids without numbers?

**URL:** <https://discourse.chef.io/t/manage-uids-and-gids-without-numbers/2183>\
**Category:** Chef Infra (archive)\
**Created:** [November 15, 2011, 4:08pm UTC](https://discourse.chef.io/t/manage-uids-and-gids-without-numbers/2183 "2011-11-15T16:08:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_Berry](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_berry/32/213_2.png) [@Bryan\_Berry](https://discourse.chef.io/u/Bryan_Berry)\
**Post date:** [November 15, 2011, 4:08pm UTC](https://discourse.chef.io/t/manage-uids-and-gids-without-numbers/2183/1 "2011-11-15T16:08:42Z")

</div>

Do i have to specify a numeric id for a user and group resources to make  
sure that gid == uid?

for example, I want to use jboss user and jboss group in my jboss cookbook

I also would like to avoid having to keep track of all the uids and gids in  
my various cookbooks

I get an error when I try to do the following

user “jboss”

group “jboss” do  
action "modify"  
members [‘bob’, ‘fred’, ‘sally’]  
end

I get the error:

“jboss” group does not exist

I don’t get this error if I specify uid in the user resource and then the  
same number for the gid in the group resource.

Is there any way I can avoid having to use numeric ids in such cases? It  
would save a lot of accounting

I need to add members to the jboss group because I have a handy little sudo  
rule that lets my devs start and stop the jboss demon

deep inside /etc/sudoers  
%jboss ALL=(jboss) NOPASSWD: ALL  
%jboss ALL=(jboss) NOPASSWD: /sbin/service [a-zA-Z]\*

---

<div class="post-metadata">

**Author:** ![Bryan\_Berry](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_berry/32/213_2.png) [@Bryan\_Berry](https://discourse.chef.io/u/Bryan_Berry)\
**Post date:** [November 16, 2011, 9:16am UTC](https://discourse.chef.io/t/manage-uids-and-gids-without-numbers/2183/2 "2011-11-16T09:16:29Z")

</div>

Alright this is pretty unintuitive but I found a fix

It works if I don't specify the uid nor gid but make sure to include the  
use as a member

user "jboss"

group "jboss" do  
members ['jboss', 'adam', 'jesse']  
end

On Tue, Nov 15, 2011 at 5:08 PM, Bryan Berry [bryan.berry@gmail.com](mailto:bryan.berry@gmail.com) wrote:

> Do i have to specify a numeric id for a user and group resources to make  
> sure that gid == uid?
> 
> for example, I want to use jboss user and jboss group in my jboss cookbook
> 
> I also would like to avoid having to keep track of all the uids and gids  
> in my various cookbooks
> 
> I get an error when I try to do the following
> 
> user "jboss"
> 
> group "jboss" do  
> action "modify"  
> members ['bob', 'fred', 'sally']  
> end
> 
> I get the error:
> 
> "jboss" group does not exist
> 
> I don't get this error if I specify uid in the user resource and then the  
> same number for the gid in the group resource.
> 
> Is there any way I can avoid having to use numeric ids in such cases? It  
> would save a lot of accounting
> 
> I need to add members to the jboss group because I have a handy little  
> sudo rule that lets my devs start and stop the jboss demon
> 
> deep inside /etc/sudoers  
> %jboss ALL=(jboss) NOPASSWD: ALL  
> %jboss ALL=(jboss) NOPASSWD: /sbin/service [a-zA-Z]\*
