![]() Show commands executed on the device could display the data in JSON or XML format (Nexus OS, Junos, Arista EOS).Your device might support NETCONF and return the required data in XML format (Junos, Nexus OS, late IOS XE, few show commands in Cisco IOS).Your device might have REST API that returns the data you need in JSON or XML format (example: late Cisco IOS XE, Junos, Arista EOS).But what if the networking device cannot do anything else but return text printout in tabular or free-form format (I’m looking at you, Cisco IOS)? Try to Get the Structured Data Firstīefore starting to build a kludge that would turn a show command printout into something that Ansible could use explore all other options: There are Ansible plug-ins that can process data returned in XML format. Articles » Ansible-related content » Parsing Text Printouts within Ansible PlaybooksĪnsible can take data produced by an external script (or show command executed on a network device) and use it in subsequent tasks in an Ansible playbook – an ideal solution if you need to collect device data to generate a report, verify device state (example: are BGP neighbors up) or check device state before configuring it (example: is another customer configured on this interface?)Īnsible can use structured data in JSON or YAML format directly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |