cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2332
Views
0
Helpful
4
Replies

Nexus Nexus7700 C7706 Json output

kevin_1234
Level 1
Level 1

Hi 

Today I tried to do some testing with automation on the Nexus 7700 with Ansible. The Ansible Modules for nxos wants it output in Json format.

So Ansible adds ad the end of every command "| json". The Nexus should support this. But I always get the error, that Python cannot load the modul xmltodict. 

Even If try for example the command directly on the cli "show version | json" I get the same, like with ansible, error:

XX# show version | json
Traceback (most recent call last):
File "/isan/python/scripts/pipejson.py", line 3, in <module>
import os, sys, shlex, json, xmltodict, re, fnmatch
ImportError: No module named xmltodict


Does someone had the same problem, or have some ideas?

Thanks and cheers, Kevin

BIOS: version 3.1.0
kickstart: version 7.2(0)D1(1)
system: version 7.2(0)D1(1)

1 Accepted Solution

Accepted Solutions

kevin_1234
Level 1
Level 1

The new version  7.2(2)D1(2) fixed this issue.

View solution in original post

4 Replies 4

kevin_1234
Level 1
Level 1

The new version  7.2(2)D1(2) fixed this issue.

Sean.Cavanaugh
Level 1
Level 1

In case you are on an older version of NXOS, the nxos_facts module is great at this.  I have a playbook here: https://github.com/network-automation/ansible-napalm-samples/blob/master/showversion.yml

---
- hosts: cisco
  connection: local
  gather_facts: False
  tasks:
    - name: run show version
      nxos_facts:
        provider: "{{login_info}}"
    - debug:
        var: ansible_net_version

Screen Shot 2017-09-27 at 3.39.32 PM.png

Hi Tanks for your reply!

can you make "show version | json "

it looks like in my version they forgot to place the python modul (xmltodict.py) in /isan/python/scipts/.

But I find nowhere any changelog about this issue.

 

Do you know can I somehow place files in this locations?

 

Cheers, Kevin

 

 

ah I see you are using n9k ;)

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: