On Tuesday, July 3, 2012 4:43:24 PM UTC-5, eduardo 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.
>
That sounds like a different issue. Certainly you should be sure that your
ENC does not emit redundant data, but the involvement of an ENC or lots of
data does not speak to the solution Nan suggested.
> 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.
>
Likely you can indeed benefit from careful application of defined types,
but that doesn't really have anything to do with implicit dependencies
(a.k.a. "autorequires").
>
> 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)
>
Your language and naming shows that you are thinking of classes and
resources as actions, but that conflicts with Puppet's design. Puppet
classes and resources are things (nouns). That includes defined type
instances. Class and resource declarations are not instructions to Puppet
to do something (not even Execs), but rather descriptions of the state that
the target node is supposed to be in. You need to understand this to
master Puppet.
> 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 ?
>
Are you asking whether you need to express the relationships between User
resources and the Group resources representing their secondary groups?
Yes, you do. Puppet does not generate those particular relationships
automatically, and the order in which the Puppet agent *applies* resources
is constrained only by resource relationships. In particular, that order
has nothing to do with the order in which resource declarations were
parsed. You need to be sure the secondary groups should already exist
before you manage users that are supposed to belong to them, so you need to
declare relationships between them.
> 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.
>
I'm glad you're pleased (now), but you are setting yourself up for pain.
In particular, you should avoid the 'defined' function at all costs, as it
introduces problematic and unneeded parse-order dependencies. With an ENC
at your disposal, 'defined' doesn't even give you anything that you cannot
easily achieve by other means.
It's not clear to me what practical problems you may now be facing, so I'm
going to leave it at commentary for the time being.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/cHEwQzBaMk4J.
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.