0

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?

3

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,
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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