cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1003
Views
0
Helpful
4
Replies
Highlighted
Beginner

Nexus Nexus7700 C7706 Json output

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)

Everyone's tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Beginner

The new version  version 7.2

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

4 REPLIES 4
Beginner

The new version  version 7.2

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

Beginner

Re: Nexus Nexus7700 C7706 Json output

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

Beginner

Re: Nexus Nexus7700 C7706 Json output

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

 

 

Beginner

Re: Nexus Nexus7700 C7706 Json output

ah I see you are using n9k ;)

CreatePlease to create content
Content for Community-Ad
July's Community Spotlight Awards