Re: [Puppet Users] Custom type, relationship and fetch order

2016-03-02 Thread Thomas Champagne
Yes, I agree with you. I have seen this solution in the "resources" type that generate resources to purge them. So, you tell : in the generate method of "group" type, it call instance method of the user provider to generate user. With this solution, if I define a user in the node, the rest

Re: [Puppet Users] Custom type, relationship and fetch order

2016-03-02 Thread Felix Frank
Hi, I'm not sure about directly forcing a prefetch action. However, it seems to me that it would make sense for you to implement a *generate* method for your group type. It should enumerate the users that are members of the group and create a Puppet resource each. (Don't worry about

Re: [Puppet Users] Custom type, relationship and fetch order

2016-03-02 Thread Thomas Champagne
Thanks for answering Felix, I solve some problems with require/before parameters in the manifest. I create a new type (user_group) that define link between user and group. The provider of user_group type call the provider of user to get the relationship. And I define new type in the manifest

Re: [Puppet Users] Custom type, relationship and fetch order

2016-02-27 Thread Felix Frank
Hi, I believe that all you have to do is taking care of the proper resource dependencies. If you really want to rely on autorequire for this, you will have to make the logic more dynamic. This is easier if you target a Puppet version that has support for autobefore in addition to

[Puppet Users] Custom type, relationship and fetch order

2016-02-19 Thread Thomas Champagne
Hi, I try to develop a new module to deploy resources with an API REST. But I have problems to define relationship between two resources. I haven't problem to fetch and flush resource individually. This two resources are fetch with a REST endpoint but I can have the relationship between