Best practice for users/groups on solaris

seph
Thu, 08 Nov 2007 22:18:30 -0000

Hi all, I''m a new puppet user and I''m running into some
weirdness
around creating users on solaris. (puppet version 0.23.2)

The virt_all_users way of managing users seems pretty reasonable, but
I don''t see how to deal with user specific groups with that.

I have:

class virt_all_users {

    @user { "seph":
        ensure  => "present",
        uid     => "1001",
        gid     => "1001",
        comment => "seph",
        home    => "/home/seph",
        shell   => "/bin/bash",
    }
}

But realizing that on a solaris machine generates an error because
group 1001 doesn''t yet exist. Specifically:

err: //virt_all_users/User[seph]/ensure: change from absent to present failed:
Could not create user seph: Execution of ''/usr/sbin/useradd -u 1001 -s
/bin/bash -d /home/seph -g 1001 -c seph seph'' returned 1536: UX:
/usr/sbin/useradd: ERROR: group 1001 does not exist.  Choose another.

So, what''s the recommended way of doing this?

seph