Viptela Support on Ansible

Does anyone have any experience using Ansible with Viptela SD-WAN products (vEdge mostly)? The ios_command module seems to work at a basic level for running simple commands but runs into issues with more complex commands.

For example, using Ansible 2.5.5 and running the following command against a vEdge-1000:

#show interface detail | display xml | nomore

Partial output is returned, but although the xml format appears correct when running command on the device, it appears to get mangled in the ansible output. What are the best ways to approach troubleshooting an issue like this?

Sample output:

ok: [HOSTNAME] => {
“print_output.stdout_lines”: [
[
“”
],
[
“<config xmlns="http://tail-f.com/ns/config/1.0\“>”,
" <interface xmlns="http://viptela.com/oper-vpn\“>”,
" 0”,
" ge0/0“,
" ipv4”,
" x.x.x.x/29“,
" Up”,
" Up“,
" NA”,
" WAN“,
" ”,
" 0“,
" x.x.x.x/29”,
" x.x.x.x“,
" false”,
" “,
" null”,
" transport“,
" 1”,
" 1500“,
" 80:b7:b9:c7:28:13”,
" 1000“,
" full”,
" true“,
" tx_pause rx_pause”,
" 1360“,
" 16:04:48:50”,
" dhcp dns icmp“,
" 114578914”,
" 34723478373“,
" 0”,
" 14697761“,
" 110381996”,
" 20019647115"
], <============== OUTPUT GETS CORRUPTED HERE
[
“0”,
" 2“,
" 258”,
" 1255“,
" 234”,
" 441“,
" 36925”,
" 36935“,
" 139781”,
" 139204“,
" 353520”,
" 0“,
" 0”
]
]
}

Hi j-16375,

We are currently doing a POC with Viptela in the lab and I’ve written an Ansible Galaxy module for it.

Do you want to try that?

Installation is by these commands:

pip install viptela-python --upgrade --force
ansible-galaxy install eugene_ky_wong.viptela_ansible --force

To get the result you need the commands needed are:

  • cd to the directory which ansible-galaxy installed to
  • modify variables.yml file to change the ‘vManage_server’ IP address and the ‘ip_address’ of your vEdge, and modify vault.yml for your login credentials.
  • run ‘ansible-playbook 4_get_interface_stats.yml’

Do let me know how that goes!

Eugene

Hi Eugine,

Great script.

I have had success using ansible uri module for API calls to attach / detach feature templates.

I have also a python script from cisco but I made my own via ansible for easier troubleshooting in the future and so that it would be human readable for my team.

Mark Garcia

Hello,

How can I configure the playbooks to work with multi-tenant.

THanks.

https://github.com/ciscodevnet/ansible-viptela