Ansible is designed to run python modules on the managed device and return JSON results.
I have a question for the community about an Ansible implementation.
If there were an Ansible EXOS module that pushed EXOS CLI commands from a playbook to a switch, and the switch returned JSON data, would that work for the Ansible users?
Playbook example: (I may not have this just right)
hosts: exosswitches
vars:
portno: ""
tasks:
-name collect port statistics
exos: show ports {{ portno }} statistics no-refresh
The data returned from an EXOS device for portno=1 would look like:
[
{
"show_ports_stats": {
"dot1dTpPortInDiscards": 0,
"dot1dTpPortInFrames": 616,
"dot1dTpPortMaxInfo": 1500,
"dot1dTpPortOutFrames": 626,
"linkState": 1,
"port": 1,
"portList": 1,
"portNoSnmp": 1,
"rxBcast": 0,
"rxByteCnt": 110071,
"rxMcast": 305,
"rxPktCnt": 616,
"txBcast": 0,
"txByteCnt": 112932,
"txMcast": 303,
"txPktCnt": 626
},
"status": "SUCCESS"
}