It's important to say that updssh::user_keys , updssh::check_groups
and updssh::load_ssh_key are defined resource types.


On 3 jul, 17:43, eduardo <erodr...@gmail.com> wrote:
>  Thanks your answers.
>  I don't figure out how avoid execute because i have a massive input
> account by ENC json setting all users and membership of each one of
> them.  I had to make uniq entries array to avoid Duplicate definition
> error condition because many users could (in fact are) belong to a
> same group.
>
>  May be i miss something but i think that i can benefit from working
> with defined resource types
> (vs classes) so the same nesting call is setting dependencies
> implicitly.
>
>  For example a big picture of nesting call in my recipe is something
> like :
>
>  class updssh( $users ) -> Parameter class having json as input.
>  └── user_keys { $arrays_users:   } Call it foreach user.
>       ├── updssh::check_groups { $usr_groups: } Call it for ensure
> membership of user
>       └── updssh::load_ssh_key{ $user_ssh :     Call it to set account
> (create/update)
>
>  So I don't see dependencies like any problem because the nesting call
> is doing by self.
>  Testing are tell me that nevertheless , i'm wondering , Am i wrong ?
>
>  Even knowing it's the first version i have to confess that i'm happy
> with it because not only resolve dependencies by self but also it
> create groups that don't exist. Also i enjoy using functions like
> 'defined' which it's great to check current status.
>
>   Regards,
>    eduardo.
>
> On 3 jul, 13:57, Nan Liu <n...@puppetlabs.com> wrote:
>
>
>
>
>
>
>
> > 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