On Tue, Jul 3, 2012 at 10:46 AM, Tim Mooney <[email protected]> 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 [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-users?hl=en.