2

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?"

1
  • 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, 2013 at 22:13

1 Answer 1

2

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

4
  • Ya I am, I'll try the spelled out version... I'll post back. Jan 14, 2013 at 21:06
  • I got gid and uid confused, see my update. Jan 14, 2013 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, 2013 at 22:14
  • 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. Jan 14, 2013 at 22:44

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .