Ask Your Question
0

Dependecy Problems with Users and Groups Types

asked 2013-08-22 15:21:48 -0500

typedeaf gravatar image

updated 2013-08-23 01:44:01 -0500

GregLarkin gravatar image

We have a module that uses the native User and Group types. I have recently tried to modify this module so that it can be used to remove users and groups. I have run into strange dependency problems.

Here is the module

define user::envdbusers( $customer = false,  $appid, $utpass = false, $prpass = false, $kcpass = false, $pepass = false, $cdcpass = '!', $remove = false ) {
    if $customer {
        $appname = $customer
    } else {
        $appname = $name
    }

    if $remove {
        $state = 'absent'
        User["${appname}in"] -> Group["${appname}in"]
        User["${appname}f"]  -> Group["${appname}f"]
        User["${appname}c"]  -> Group["${appname}a"]
    } else {
        $state = 'present'
        Group["${appname}in"] -> User["${appname}in"]
        Group["${appname}f ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-08-23 19:05:45 -0500

Trevor Vaughan gravatar image

According to the user type docs:

**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.

Checking the 'autorequires' code, it appears that this is not reversed for deletion so you'll need two runs for deletion of all user and group resources due to the internal dependency chains.

This bug report https://projects.puppetlabs.com/issues/428 appears to be what you were running into ... (more)

edit flag offensive delete link more

Comments

Thanks. I went the lazy route and just create a different defined type to remove users. It is hard to believe that this isn't a common problem.

typedeaf gravatar imagetypedeaf ( 2013-08-29 17:26:38 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-08-22 15:21:48 -0500

Seen: 210 times

Last updated: Aug 23 '13