Problem using nxos_command module

126 views
Skip to first unread message

Roger Gomez

unread,
Mar 4, 2016, 6:52:37 PM3/4/16
to Ansible Project
I have been trying to test the Cisco NXOS modules and the nxos_command is failing and I don't understand why:
cmd.yml
---
- hosts:
  - leaf-switch
  gather_facts: no
  tasks:
  - nxos_command:
     username: user
     password: password
     commands:
     - show version
     transport: nxapi
     use_ssl: no
     host: leaf-switch
    delegate_to: localhost

When I run the playbook I have this back:
PLAY ***************************************************************************

TASK [nxos_command] ************************************************************
fatal: [leaf-switch -> localhost]: FAILED! => {"changed": false, "failed": true, "msg": "HTTP Error 400: Bad Request", "status": 400, "url": "http://leaf-switch:80/ins"}

NO MORE HOSTS LEFT *************************************************************
to retry, use: --limit @com.retry

PLAY RECAP *********************************************************************
leaf-switch                : ok=0    changed=0    unreachable=0    failed=1

The switch is enable for NXAPI and I can use it, if I only change the transport from nxapi to cli everything works just fine.
Any idea what could be the reason?
Thanks. 
 

pspr...@ansible.com

unread,
Mar 6, 2016, 10:43:54 PM3/6/16
to Ansible Project
HI Roger,

Two questions:

1) Are you able to browse to http://leaf-switch:80/ins (assuming you have nxapi sandbox configured)?

2) What platform and nxos version are you running?

Roger Gomez

unread,
Mar 7, 2016, 2:29:22 PM3/7/16
to Ansible Project
Thank you for helping me with this issue. I have responded inside your previous email.

On Sunday, March 6, 2016 at 10:43:54 PM UTC-5, pspr...@ansible.com wrote:
HI Roger,

Two questions:

1) Are you able to browse to http://leaf-switch:80/ins (assuming you have nxapi sandbox configured)?
 Yes, I'm able to browse and make REST API calls. 

2) What platform and nxos version are you running?
This test was in n9000-dk9.7.0.3.I1.2.bin but I also did it in on 6.1(2)I3(1). 

Roger Gomez

unread,
Mar 7, 2016, 5:44:45 PM3/7/16
to Ansible Project


On Sunday, March 6, 2016 at 10:43:54 PM UTC-5, pspr...@ansible.com wrote:
HI Roger,

Two questions:

1) Are you able to browse to http://leaf-switch:80/ins (assuming you have nxapi sandbox configured)?
    Yes, I'm able to browse and make REST API calls.  

2) What platform and nxos version are you running?
   This test was in n9000-dk9.7.0.3.I1.2.bin but I also did it in on 6.1(2)I3(1) 



pspr...@ansible.com

unread,
Mar 9, 2016, 3:46:49 PM3/9/16
to Ansible Project
Thanks for the additional details.  Its definitely a bug that affects the 9K (the nxapi implementation is a little different).  Working on a fix that will be available soon

Roger Gomez

unread,
Mar 9, 2016, 3:48:17 PM3/9/16
to Ansible Project
Thanks.
Reply all
Reply to author
Forward
0 new messages