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.

Reply via email to