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

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
add comment

1 Answer

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
add comment

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.