# bug in nxos\_config module

**URL:** <https://forum.ansible.com/t/bug-in-nxos-config-module/33224>\
**Category:** Ansible Developer\
**Created:** [June 21, 2020, 4:14am UTC](https://forum.ansible.com/t/bug-in-nxos-config-module/33224 "2020-06-21T04:14:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [June 21, 2020, 4:14am UTC](https://forum.ansible.com/t/bug-in-nxos-config-module/33224/1 "2020-06-21T04:14:30Z")

</div>

Hi Team

nxos\_config module where Ansible cannot able to return below highlighted information from device rather it returns the config as changed.

Is this a bug? please help

Manual:

lab.device.local(config)# logging server x.x.x.x 6  
Can’t configure more than 8 IP Servers

Through Ansible:

changed: [lab.device.local] =\> {  
“changed”: true,  
“commands”: [  
“logging server x.x.x.x 6”,  
“logging server x.x.x.x 6”  
],  
“invocation”: {  
“module\_args”: {  
“after”: null,  
“auth\_pass”: null,  
“authorize”: null,  
“backup”: false,  
“before”: null,  
“defaults”: false,  
“diff\_against”: null,  
“diff\_ignore\_lines”: null,  
“force”: false,  
“host”: null,  
“intended\_config”: null,  
“lines”: [  
“logging server x.x.x.x 6”,  
“logging server x.x.x.x 6”  
],  
“match”: “line”,  
“parents”: null,  
“password”: null,  
“port”: null,  
“provider”: null,  
“replace”: “line”,  
“replace\_src”: null,  
“running\_config”: null,  
“save”: false,  
“save\_when”: “never”,  
“src”: null,  
“ssh\_keyfile”: null,  
“timeout”: null,  
“transport”: null,  
“use\_ssl”: null,  
“username”: null,  
“validate\_certs”: null  
}  
},  
“updates”: [  
“logging server x.x.x.x 6”,  
“logging server x.x.x.x 6”  
]  
}

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [June 24, 2020, 6:29am UTC](https://forum.ansible.com/t/bug-in-nxos-config-module/33224/2 "2020-06-24T06:29:28Z")

</div>

Any help would be appreciated !

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [July 2, 2020, 2:04pm UTC](https://forum.ansible.com/t/bug-in-nxos-config-module/33224/3 "2020-07-02T14:04:44Z")

</div>

Can anyone help on this?

---

<div class="post-metadata">

**Author:** ![Karol\_Czeryna](https://avatars.discourse-cdn.com/v4/letter/k/ed655f/32.png) [@Karol\_Czeryna](https://forum.ansible.com/u/Karol_Czeryna)\
**Post date:** [July 2, 2020, 2:20pm UTC](https://forum.ansible.com/t/bug-in-nxos-config-module/33224/4 "2020-07-02T14:20:47Z")

</div>

Hi Pushparaj,

You can try to use changed\_when. Haven't used nxos\_config unfortunately yet.

Best,  
Karol

---

<div class="post-metadata">

**Author:** ![acozine1](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@acozine1](https://forum.ansible.com/u/acozine1)\
**Post date:** [July 2, 2020, 2:30pm UTC](https://forum.ansible.com/t/bug-in-nxos-config-module/33224/5 "2020-07-02T14:30:59Z")

</div>

See [https://docs.ansible.com/ansible/devel/user\_guide/playbooks\_error\_handling.html#defining-changed](https://docs.ansible.com/ansible/devel/user_guide/playbooks_error_handling.html#defining-changed) for more details on changed\_when.

---

<div class="post-metadata">

**Author:** ![Nilashish\_Chakrabort](https://avatars.discourse-cdn.com/v4/letter/n/f475e1/32.png) [@Nilashish\_Chakrabort](https://forum.ansible.com/u/Nilashish_Chakrabort)\
**Post date:** [July 3, 2020, 6:23am UTC](https://forum.ansible.com/t/bug-in-nxos-config-module/33224/6 "2020-07-03T06:23:22Z")

</div>

Hi Pushparaj,

This seems to happen because the stderr regex in the NX-OS terminal plugin doesn’t catch “Can’t configure more than 8 IP Servers”. However, with Ansible 2.9, the stdout and stderr regexes were made configurable options. Please refer to [https://docs.ansible.com/ansible/latest/network/user\_guide/network\_debug\_troubleshooting.html#task-failure-due-to-mismatched-error-regex-within-command-response-using-network-cli-connection-type](https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html#task-failure-due-to-mismatched-error-regex-within-command-response-using-network-cli-connection-type) for more information.

In this particular case, you can try adding the following to the task:  
vars:  
ansible\_terminal\_stderr\_re:

- pattern: “can’t configure (.\*)”  
flags: 're.I

Thanks!

---

<div class="post-metadata">

**Author:** ![Pushparaj\_Gothandam](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/pushparaj_gothandam/32/5538_2.png) [@Pushparaj\_Gothandam](https://forum.ansible.com/u/Pushparaj_Gothandam)\
**Post date:** [July 6, 2020, 3:38am UTC](https://forum.ansible.com/t/bug-in-nxos-config-module/33224/7 "2020-07-06T03:38:16Z")

</div>

Thanks Nilashish …
