Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 debian boxes. One with puppetmaster, second with puppetd.

# puppet -V
2.7.18

In manifest i have:

group {
    "tipadima":
        ensure   => present,
}
user {
    "tipadima":
        shell => $operatingsystem ? {
            FreeBSD  => '/usr/local/bin/zsh',
            Debian => '/usr/bin/zsh',
        },
        comment  => 'tipadima',
        home     => '/home/tipadima',
        password => '$1$Iasdfsa33Pv$6vF/Pe.Xr.Nv0gGl.VNjx/',
        groups   => 'tipadima',
        require =>   Group["tipadima"] ,
        ensure   => present,
}

But this produce an error on client:

info: Applying configuration version '1359531648' err: /Stage[main]/Tipadima_files/User[tipadima]/ensure: change from absent to present failed: Could not create user tipadima: Execution of '/usr/sbin/useradd -s /usr/bin/zsh -d /home/tipadima -G tipadima -c tipadima -p $1$sdgdf$6vF/Pe.Xr.Nv0gGl.VNjx/ tipadima' returned 9: useradd: group tipadima exists - if you want to add this user to that group, use -g.

Why, and how to fix that?

share|improve this question
up vote 3 down vote accepted

You should use gid to specify the primary group, groups is for secondary membership

user {
    "tipadima":
        shell => $operatingsystem ? {
            FreeBSD  => '/usr/local/bin/zsh',
            Debian => '/usr/bin/zsh',
        },
        comment  => 'tipadima',
        home     => '/home/tipadima',
        password => '$1$Iasdfsa33Pv$6vF/Pe.Xr.Nv0gGl.VNjx/',
        gid      => 'tipadima',
        ensure   => present,
}
share|improve this answer
    
Thanks! That works – Korjavin Ivan Jan 30 '13 at 9:36

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.