howdy all, I have a problem with save_when: modified on nx-os. It seems like this is not working idempotently on Cisco Nexus devices N5k, N6k and fails on N7k (with a timeout), but seemingly works for N9k. The module is always flagging things as changed even when the config is already saved. save_when: modified is only supposed to save if there are uncommitted changes? I looked for a bug on git but was not able to find one. I'm running ansible 2.6.2.
my simple task
---
- name: NX-OS Save Config (nx-os config)
nxos_config:
provider: "{{ prov }}"
save_when: modified
I even did a copy run start on this device before I ran this task
TASK [NX-OS Save Config (nx-os config)] **************************************************************************************************************
task path: /opt/peo/network-services/roles/save/tasks/nx-os-save_when.yml:6
<nexus5k.local> using connection plugin network_cli (was local)
<nexus5k.local> ESTABLISH LOCAL CONNECTION FOR USER: someguy
<nexus5k.local> EXEC /bin/sh -c 'echo ~someguy && sleep 0'
<nexus5k.local> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/someguy/.ansible/tmp/ansible-tmp-1542740419.89-75701338571601
`" && echo ansible-tmp-1542740419.89-75701338571601="` echo /home/someguy/.ansible/tmp/ansible-tmp-1542740419.89-75701338571601 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible-2.6.2-py2.7.egg/ansible/modules/network/nxos/nxos_config.py
<nexus5k.local> PUT /home/someguy/.ansible/tmp/ansible-local-566uB4KpP/tmp3gi7IQ TO /home/someguy/.ansible/tmp/ansible-tmp-15427404
19.89-75701338571601/nxos_config.py
<nexus5k.local> EXEC /bin/sh -c 'chmod u+x /home/someguy/.ansible/tmp/ansible-tmp-1542740419.89-75701338571601/ /home/someguy/.ansi
ble/tmp/ansible-tmp-1542740419.89-75701338571601/nxos_config.py && sleep 0'
<nexus5k.local> EXEC /bin/sh -c '/usr/bin/python /home/someguy/.ansible/tmp/ansible-tmp-1542740419.89-75701338571601/nxos_config.py
&& sleep 0'
<nexus5k.local> EXEC /bin/sh -c 'rm -f -r /home/someguy/.ansible/tmp/ansible-tmp-1542740419.89-75701338571601/ > /dev/null 2>&1 &&
sleep 0'
changed: [nexus5k.local] => {
"changed": true,
"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": "nexus5k.local",
"intended_config": null,
"lines": null,
"match": "line",
"parents": null,
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 22,
"provider": {
"auth_pass": null,
"authorize": null,
"host": "nexus5k.local",
"password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"port": 22,
"ssh_keyfile": null,
"timeout": 60,
"transport": "cli",
"use_proxy": true,
"use_ssl": null,
"username": "someguy",
"validate_certs": null
},
"replace": "line",
"replace_src": null,
"running_config": null,
"save": false,
"save_when": "modified",
"src": null,
"ssh_keyfile": null,
"timeout": 60,
"transport": "cli",
"use_proxy": true,
"use_ssl": null,
"username": "someguy",
"validate_certs": null
}
}
}
META: ran handlers
META: ran handlers
PLAY RECAP *******************************************************************************************************************************************
nexus5k.local : ok=5 changed=1 unreachable=0 failed=0