Issue #14672 has been updated by Eric Shamow.

So this seems like it's really to do with RHEL's user provider.

Since userdel on RHEL removes the primary group as well, and since the user 
resource is evaluated first, by the time Puppet reaches the group resource it 
has nothing to do.

This is actually a really good example of (unexpected?) vendor non-atomic 
behavior.

-Eric
----------------------------------------
Bug #14672: defined types hides notices
https://projects.puppetlabs.com/issues/14672#change-63614

Author: Matthew Pounsett
Status: Unreviewed
Priority: Normal
Assignee: 
Category: language
Target version: 
Affected Puppet version: 
Keywords: defined types, notice
Branch: 


It looks like defined types hide notices from an admin.  Working through the PE 
training I ran into this case:

<pre>
define usermanagement ($ensure) {
  user { $name :
    gid        => $name,
    ensure     => $ensure,
  }
  group { $name :
    ensure     => $ensure,
  }

  case $ensure {
    present: { Group[$name] -> User[$name] }
    absent:  { Group[$name] <- User[$name] }
  }
}
</pre>

The result when this is run with ensure => present, it *seems* to be okay..

<pre>
usermanagement { 'matt':
  ensure => present,
}
</pre>
    [root@training usermanagement]# puppet apply ./tests/init.pp
    notice: /Stage[main]//Usermanagement[matt]/Group[matt]/ensure: created
    notice: /Stage[main]//Usermanagement[matt]/User[matt]/ensure: created
    notice: Finished catalog run in 0.18 seconds
   
However, when I run this with ensure => absent, the group removal notice is 
mysteriously absent from the output.

<pre>
usermanagement { 'matt':
  ensure => absent,
}
</pre>
    [root@training usermanagement]# puppet apply ./tests/disable.pp
    notice: /Stage[main]//Usermanagement[matt]/User[matt]/ensure: removed
    notice: Finished catalog run in 0.14 seconds
    
However, the group is definitely removed:

    [root@training usermanagement]# grep matt /etc/group
    [root@training usermanagement]# 
    



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to