# Questions about Ansible NXOS command

**URL:** <https://forum.ansible.com/t/questions-about-ansible-nxos-command/21040>\
**Category:** Ansible Project\
**Created:** [April 1, 2016, 2:13am UTC](https://forum.ansible.com/t/questions-about-ansible-nxos-command/21040 "2016-04-01T02:13:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ludi\_Fang](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@Ludi\_Fang](https://forum.ansible.com/u/Ludi_Fang)\
**Post date:** [April 1, 2016, 2:13am UTC](https://forum.ansible.com/t/questions-about-ansible-nxos-command/21040/1 "2016-04-01T02:13:37Z")

</div>

Hello support team,

when I enter this command,

ansible test -m nxos\_command

it gives me the following error:

10.122.234.253 | FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“msg”: “missing required arguments: username,host”  
}

It seems lack of some parameters, however, there’s no more information about how to put the parameters in the command.  
We want to excute “‘show version’” and “‘show running-config’” , can you help me, thanks!

---

<div class="post-metadata">

**Author:** ![psprygada](https://avatars.discourse-cdn.com/v4/letter/p/898d66/32.png) [@psprygada](https://forum.ansible.com/u/psprygada)\
**Post date:** [April 2, 2016, 12:38am UTC](https://forum.ansible.com/t/questions-about-ansible-nxos-command/21040/2 "2016-04-02T00:38:09Z")

</div>

You need to pass the required arguments to the module in order for it to run properly. Below is an example of running Ansible to collect the output from show running-config.

ansible -m nxos\_command -a “host=nxos01 username=admin password=admin commands=‘show running-config’” localhost --connection local

An example playbook with output can be found here: [https://gist.github.com/privateip/cd979aff53d7f4ba6fec854580e18a1d](https://gist.github.com/privateip/cd979aff53d7f4ba6fec854580e18a1d)

---

<div class="post-metadata">

**Author:** ![Lisa\_Huang](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Lisa\_Huang](https://forum.ansible.com/u/Lisa_Huang)\
**Post date:** [July 1, 2016, 6:25pm UTC](https://forum.ansible.com/t/questions-about-ansible-nxos-command/21040/3 "2016-07-01T18:25:44Z")

</div>

Is this issue resolved? I am getting connection timed out error. Are there any extra configuration needed on nxos or ansible? I tested NX-API Developer Sandbox and able to receive response in json.

[lisa.huang@asvjmp01 ~]$ ansible -m nxos\_command -a “host=10.2.253.100 username=admin password=password commands=‘show version’ transport=nxapi use\_ssl=no” localhost --connection local  
localhost | FAILED! =\> {  
“changed”: false,  
“failed”: true,  
“msg”: “Connection failure: timed out”,  
“status”: -1,  
“url”: “[http://10.2.253.100:80/ins](http://10.2.253.100:80/ins)”  
}

show feature | inc nxapi

nxapi 1 enabled

ansible --version

ansible 2.1.0.0

config file = /etc/ansible/ansible.cfg

configured module search path = Default w/o overrides
