Dominic,

You may be running into some circular reasoning in how you are trying to
setup the group/user. The user if GID is supplied will require the group.
By linking the user as a dependency of the group causes puppet to choke.

http://docs.puppetlabs.com/references/latest/type.html#user

Autorequires: If Puppet is managing the user’s primary group (as provided
in the gid attribute), the user resource will autorequire that group. If
Puppet is managing any role accounts corresponding to the user’s roles, the
user resource will autorequire those role accounts.


On Thu, Oct 31, 2013 at 6:03 PM, Dominic Scheirlinck <domi...@vendhq.com>wrote:

> Here's a bit of manifest code for a user and group. Note the explicit
> ordering between the resources, but also notice we're not explicitly
> specifying the ensure => present for either:
>
> group {
> 'something':;
> } -> user {
> 'something':
> gid    => 'something';
> }
>
> With the explicit ordering, I get:
>
> > Debug: /Group[something]/before: requires User[something]
>
> And without it, I get:
>
> > Debug: /User[something]: Autorequiring Group[something]
>
> So, the ordering at least seems to be noticed. But, regardless (in both
> cases), puppet attempts to add the user first, without attempting to add
> the group:
>
> > Debug: /User[something]: Autorequiring Group[something]
> > Info: Applying configuration version '1383263341'
> > Debug: Executing '/usr/sbin/useradd -g something something'
> > Error: Could not create user something: Execution of '/usr/sbin/useradd
> -g something something' returned 6: useradd: group 'something' does not
> exist
> > Error: /User[something]/ensure: change from absent to present failed:
> Could not create user something: Execution of '/usr/sbin/useradd -g
> something something' returned 6: useradd: group 'something' does not exist
>
> The manifest code above is the only thing in the file, and I'm using
> `puppet apply` to run it to really get it down to a minimal test case.
>
> This seems to be because a group resource without an explicit ensure =>
> 'present' will never be created. However, a user resource without an
> explicit ensure will. This seems weirdly inconsistent, and there's no
> mention of the distinction that I could see in the Type Reference
> documentation. Is it an expected difference between the types? Or just a
> matter of undefined behaviour when ensure isn't given to resources (some
> ensure present, some do nothing)?
>
>
> Regards,
> Dominic
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/47f430b9-7229-401a-80a0-2e9a8f88e2dc%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAOwhAcq%3D%2BUJsbGxw69nnHMnCB-KNCw1sAvggaKabFyjs_t_GUw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to