All: I know Brice is the expert. Not sure if anyone else wants to dive in and give some quick hints on how to extend Puppet 2.7 network devices.
1. Network devices are a bit weird, since they don't collect facts through facter, the cisco device facts reside in: lib/puppet/util/network_device/cisco/facts.rb I'm presuming instead of writing custom facts in the regular location, simply use lib/puppet/util/network_device/f5/..? Not too sure what's the best way to test this without invoking a full puppet run and digging through yaml file on server side. 2. In terms of developing, at the moment I'm writing F5 as puppet resources with connectivity hardcoded to simplify testing since I can run puppet resource f5_rules and get instant feedback. Not sure if anyone can give some tips on testing (perhaps a Brice only question). I'm planning to refactor later so it's implemented as a network_device. 3. I'm repeating over and over again in certain sections, and I'm trying to to simplify them (I suppose time to learn metaprogramming in Ruby?) for example the way to retrieve resource attributes are pretty similar: 24 def action_on_service_down 25 @@bigip[@@modules].get_action_on_service_down(resource[:name]).first 26 end 27 28 def allow_nat_state 29 @@bigip[@@modules].get_allow_nat_state(resource[:name]).first 30 end 4. F5 uses icontrol gem via soap to query/manipulate the device, so I don't need most of the network_device functionality. I just need to parse the device url string to obtain the username/password/ip. That's not the problematic part, the issue I'm running into is it's not loading the f5 provider: class Puppet::Provider::F5 < Puppet::Provider::NetworkDevice def self.device(url='ssh://admin:[email protected]/') Puppet::Util::NetworkDevice::F5::Device.new(url) end end I was hoping to stub this so I can do testing without a full puppet run, not sure if that's the right way. The problem at the moment is it simply can't find the provider F5. and I have no idea why it's not seeing this file, where should this be placed in the modules directory? It's currently in modules f5 lib/puppet/provider/f5.rb: Could not run: Could not autoload f5_pool: Could not autoload /Users/nan/.puppet/modules/f5/lib/puppet/provider/f5_pool/f5_pool.rb: Could not find parent provider F5 of f5_pool Any feedback is appreciated. Thanks, Nan -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. 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-dev?hl=en.
