Another option might be to call the facts indirector with the
network_device terminus from the confine block itself... Something like
confine :true => begin
a = Puppet::Node::Facts.indirection
a.terminus_class = :network_device
a.find(Puppet::Indirector::Request.new(:facts, :find, "clustered",
nil))
rescue
:false
end
I haven't tested this, but maybe it'll get you down the road before this is
fixed.
On Thursday, June 5, 2014 1:40:11 AM UTC-7, Gavin Williams wrote:
>
> Eric
>
> Cheers for the response. That's a shame that it's a big change to support,
> as the missing functionality kinda makes Network Device support feel a bit
> 2nd class citizen... :(
>
> Will take a look at the yum/up2date > rpm relationship and see if I can
> work something from there...
>
> Cheers
> Gavin
>
> On Wednesday, 4 June 2014 22:19:59 UTC+1, Eric Sorenson wrote:
>>
>> That's going to be a scary thing to change.
>>
>> Gavin can you use two providers for the same type, and just not set a
>> default, so the user (or a top-level class you inherit from) sets a
>> resource default for the 'provider' metaparameter? If there is code to
>> share between the providers you can use the 'parent' mechanism in the
>> provider api, like the way 'up2date' and 'yum' both use 'rpm' as their
>> parent.
>>
>> --eric0
>>
>> On Tuesday, June 3, 2014 1:29:39 AM UTC-7, Gavin Williams wrote:
>>>
>>> Brice
>>>
>>> Damn, I had a feeling that might be the case :(
>>>
>>> Have raised PUP-2717 [1]. Let me know if you need any further info...
>>>
>>> Cheers
>>> Gavin
>>> [1] https://tickets.puppetlabs.com/browse/PUP-2717
>>>
>>> On Tuesday, 3 June 2014 09:12:03 UTC+1, Brice Figureau wrote:
>>>>
>>>> Hi,
>>>>
>>>> On Mon, 2014-06-02 at 14:42 -0700, Gavin Williams wrote:
>>>> > Hey all,
>>>> >
>>>> > I'm trying to use 'confine' on a network device provider to restrict
>>>> > based on fact gathered from the network device.
>>>> >
>>>> > However for the life of me, I just cant get it to work...
>>>> > The code looks like [1].
>>>> >
>>>> > As you can see, I'm trying to confine on the 'clustered' fact, which
>>>> > you can see is set in [2].
>>>> >
>>>> > The logs of a puppet device run show 'Could not find a suitable
>>>> > provider for netapp_volume' - full run is [3].
>>>> >
>>>> > I'm currently using Puppet 3.5.1, with webrick. Though not sure if
>>>> > that should make a difference.
>>>> >
>>>> > So, should confine based on network device facts work?!
>>>>
>>>> I don't think this can work, because the confiner uses Facter directly
>>>> instead of delegating to the fact terminus. Thus it looks into the
>>>> hosts
>>>> facts instead of asking the network devices facts.
>>>>
>>>> Unfortunately beside modifying the confiner system, I don't see any
>>>> workarounds.
>>>> Can you open a ticket, I'll see if I can come with a solution to this
>>>> issue.
>>>>
>>>> Thanks!
>>>>
>>>> --
>>>> Brice Figureau
>>>> My Blog: http://www.masterzen.fr/
>>>>
>>>>
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-dev/3fb4b98f-fa20-4a03-9fd6-7cd617006cb3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.