Moved the work for adding default implementations for default networking facts for IOS to MODULES-9459. Remodelling this ticket for the work to add custom facts capabilities to Resource API.
Since none of the remote content goes through facter - and the local execution model of facter also doesn't lend itself to extension, `puppet device` directly delegates facts collection to the {{Device}} class. In the course of this, the possibility for customers to inject custom facts has been lost.
With the advent of Resource API Transports, we now have a architectural fault line where we can re-insert that capability.
-Specifically customers want to be able to get the IP address of their IOS devices as a fact.- moved -to MODULES-9459-
CurrentlySince none of the remote content goes through facter - and the local execution model of facter also doesn't lend itself to extension, `puppet device` directly delegates the collection of facts collection to the module being used {{Device}} class.
This prevents In the course of this, the possibility for customers to inject custom facts from being used has been lost.
Investigate if it is possible to integrate custom facts into `puppet device`With the advent of Resource API Transports, we now have a architectural fault line where we can re-insert that capability.
-Specifically customers want to be able to get the IP address of their IOS devices as a fact.- moved -to MODULES-9459-
Since none of the remote content goes through facter - and the local execution model of facter also doesn't lend itself to extension, `puppet device` directly delegates facts collection to the {{Device}} class. In the course of this, the possibility for customers to inject custom facts has been lost.
With the advent of Resource API Transports, we now have a architectural fault line where we can re-insert that capability.
-Specifically customers want to be able to get the IP address of their IOS devices as a fact.- moved to MODULES-9459
----
* custom remote facts go to {{lib/puppet/remote_facts/TRANSPORT/NAME.rb}}, and can be deployed through any module * custom remote facts never get loaded on the server * puppet device and friends load all custom remote facts for the current transport * custom remote facts directly interact with the transport and can modify the facts hash at will (add/delete/modify) * custom remote facts need to ensure they do not interfere with each other
Puppet::ResourceApi::Transport.register_fact(:cisco_ios) do |context, facts| facts[:ifspeeds] = PuppetX::Customer::Site::CiscoIosUtility.parse_ifspeeds(context.transport.run_command('show interfaces')) end {code}
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to puppe...@googlegroups.com
The example adds a custom fact for {{cisco_ios}} devices that parses out some information from the {{show interfaces}} command using a helper method from {{puppet_x/customer/site/cisco_ios_utility}}.
Note how the transport name and fact implementation is passed into {{Puppet::ResourceApi::Transport.register_fact}} to be stored and used when required.