is it possible to choose the provider based on property?

For example, I'm trying to develop two different providers for same type
of resource. If i use path location on the local filesystem I want
provider "local" to be chosen, and if I use link property, then I want
provider "remote" to be chosen.

For example, this definition should chose provider 'local':

resource { 'a':
   path => '/some/local/disk.iso',

And this definition should chose provider 'remote':

resource { 'a':
   link => 'http://example.com/disk.iso',

Is this possible without manually specifying "provider => remote"?

Also, second question. It would be great if puppet could raise error in
case when both conflicting properties are set. For example this should
yeild an error:

resource { 'a':
   path => '/some/local/disk.iso',
   link => 'http://example.com/disk.iso',

Is this possible?

If these questions are more suitable to puppet-dev list, I will post
them there. Thank you guys.

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

Follow ups

Related Discussions

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

2 users in discussion

Jakov Sosic: 2 posts Jcbollinger: 1 post



site design / logo © 2021 Grokbase