Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I just puppetized mysql and ran into a weird issue where the gid for the mysql group on dev differs from production. Apparently on production I have a user that doesn't exist on the dev environment and is currently claiming the gid I wish to use for the mysql group.

My question is, what is the best approach for ensuring users/groups line up regardless of the environment? I have read some articles where it's common practice to start uid/gid @ 1000. If I enforce this practice and change existing uid/gid, will that wreck havoc with my servers?

I was also considering changing the gid of the user who is claiming the gid I wish to use, but wanted to see if there was a best practice for resolving this situation.

-- Update --

Ugh, can tell it's a monday. It's not the gid that's colliding, it's uid:

class user::mysql inherits user {

    include group::logger
    include group::mysql

    user { 'mysql':
        gid         => 'mysql',
        groups      => [ 'logger' ],
        managehome  => false,
        membership  => 'inclusive',
        require     => Class['group::mysql'],
        shell       => '/sbin/nologin',
        uid         => '498'
    }

    Class['group::logger']->Class['user::mysql']
}

Aforementioned questions are still relevant:

"What is the best approach for ensuring users/groups line up regardless of the environment?"

"If I enforce this practice and change existing uid/gid, will that wreck havoc with my servers?"

share|improve this question
    
see my edit.. you can remove the uid and even the gid line if you want and let the OS pick it.. most I've seen will pick a gid the same as the username. –  Mike Jan 14 '13 at 22:13

1 Answer 1

up vote 2 down vote accepted

My guess is you are doing something like

group => 500,

Where 500 is the group id of mysql? Well if you don't care that the group id's are a mis-match then just use the name

group => "mysql",

EDIT

Same goes for uid.. if you don't specify one for the user the OS will pick one for you. So if you don't care that uid's match up.. then remove the uid line

share|improve this answer
    
Ya I am, I'll try the spelled out version... I'll post back. –  Mike Purcell Jan 14 '13 at 21:06
    
I got gid and uid confused, see my update. –  Mike Purcell Jan 14 '13 at 22:12
    
see my edit..and comment.. you can remove the uid line if you don't care about numbers matching up –  Mike Jan 14 '13 at 22:14
    
I see, ok I'll give that try. Thanks. –  Mike Purcell Jan 14 '13 at 22:16
    
That was it. Being a puppet newb I was giving too much stock to the example configs I was seeing around the net, I never considered it would be ok to remove the hard-coded reference to uid within the manifests. Thanks again. –  Mike Purcell Jan 14 '13 at 22:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.