On Tue, Jul 3, 2012 at 10:46 AM, Tim Mooney <tim.moo...@ndsu.edu> wrote:
> In regard to: [Puppet Users] Re: groups dependencies at user creation,...:
>
>
>> Thanks tim for answer me, The fact is $groups is an array, so when i
>> try something like this
>>
>> ------
>>            Group[$groups] -> User[$username]
>>
>>            user { $username:
>>                    comment => "$email",
>>                    home    => "/home/$username",
>>                    shell   => "/bin/bash",
>>                    password => "!!",
>>                    groups  => $groups
>>            }
>>
>> ------
>>
>> I'd got :
>>
>> err: Could not retrieve catalog from remote server: Error 400 on
>> SERVER: Could not find resource 'Group[sudo]Group[admin]Group[deploy]'
>> for relationship on 'User[ppuser7]' on node casa
>
>
> I was afraid that might be the case, but thought it was worth a try.
>
> Does this work better:
>
>         $groups_as_array = split($groups, ',')
>         Groups[$groups_as_array] -> User[$username]

AFAIK, the short hand syntax doesn't support array values, and you
need something like a define resource type to wrap this.

define group_dep($username) {
   Groups[$name] -> User[$username]
}

group_dep { $group_as_array :
  username => $username,
}

Nan

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to