bug in nxos_config module

45 views
Skip to first unread message

Pushparaj Gothandam

unread,
Jun 21, 2020, 12:14:30 AM6/21/20
to Ansible Development
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"
    ]
}

Pushparaj Gothandam

unread,
Jun 24, 2020, 2:29:28 AM6/24/20
to Ansible Development
Any help would be appreciated !

Pushparaj Gothandam

unread,
Jul 2, 2020, 10:04:44 AM7/2/20
to Ansible Development
Can anyone help on this?

Karol Czeryna

unread,
Jul 2, 2020, 10:20:54 AM7/2/20
to Pushparaj Gothandam, Ansible Development
Hi Pushparaj,

You can try to use changed_when. Haven't used nxos_config unfortunately yet.

Best,
Karol
> --
> You received this message because you are subscribed to the Google Groups "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/46fc695e-dbe2-4515-a9e7-1b888208bedfo%40googlegroups.com.

alicia

unread,
Jul 2, 2020, 10:31:13 AM7/2/20
to Karol Czeryna, Pushparaj Gothandam, Ansible Development

Nilashish Chakraborty

unread,
Jul 3, 2020, 2:23:38 AM7/3/20
to rajtheco...@gmail.com, Karol Czeryna, Ansible Development, aco...@redhat.com
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 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!


--
Nilashish Chakraborty
Software Engineer, Ansible Network





Pushparaj Gothandam

unread,
Jul 5, 2020, 11:38:16 PM7/5/20
to Ansible Development
Thanks Nilashish ...
To unsubscribe from this group and stop receiving emails from it, send an email to ansibl...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansibl...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansibl...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages