FAQ

On 07/18/2013 03:07 PM, jcbollinger wrote:

Not to my knowledge, no.

This is not the correct provider paradigm. The provider for a given
resource type used on a given node, if not specified explicitly, is
supposed to be chosen based on the characteristics of the node, not of
the resource. You seem to be artificially separating your provider into
two pieces. My recommendation would be to create one provider whose
behavior varies according to the resource's properties, instead of
trying to make the choice between different providers depend on resource
properties.
Thing I'm trying to accomplish is to enable the 'cobblerdistro' provider
to be able to add new distro to cobbler either via 'cobbler distro add'
or 'cobbler import'.

Those two commands work very differently, and although a result of both
is a 'distro' (in cobbler terms), they are quite different.

So, I was thinking maybe to develop separate providers, and the one that
is called depends on the params/properties set.

I think you can use the property validation hook to accomplish this. It
is focused on validating individual properties, and there is no
guarantee of which property will be validated first, but all you really
need is to raise / check a flag an the resource instance as part of the
validation of each of those properties. You raise an ArgumentError if
the validation code for either property finds that the flag is already
raised. See http://docs.puppetlabs.com/guides/custom_types.html for
general details on the property validation hook.
OK, I will try that.

No, puppet-dev is for discussion of the development of Puppet itself,
not for questions about its use. "Development" of Puppet manifests is a
usage issue with respect to the Puppet program.
Although this is a provider discussion and not pure manifest... that's
why I asked.


Thank you jcbollinger!

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 3 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJul 17, '13 at 6:29p
activeJul 18, '13 at 2:46p
posts3
users2
websitepuppetlabs.com

2 users in discussion

Jakov Sosic: 2 posts Jcbollinger: 1 post

People

Translate

site design / logo © 2021 Grokbase