Closed jkrabbe closed 4 years ago
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @chrisvanheuveln @jedelman8 @mikewiebe @rahushen @trishnaguha click here for bot help
@jkrabbe, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network
on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community
Some additional information:
The problem comes from the fact that nxos_interface tries to do show interface {0}
with the interface name. For a non-existent port-channel interface this command fails.
Now there is different problems with the nxos_interface module.
"output": {
"code": "400",
"msg": "CLI execution error",
"clierror": "Invalid range\n",
"input": "show run interface port-channel502"
}
But the body variable seems to only have the command and msg
in it, i.e.:
[u'show interface port-channel502: CLI execution error']
As there is no proper error detection for this the map_config_to_obj
function gets an exception in https://github.com/ansible/ansible/blob/b7ab8f9411267bed4eb4d5ba62698af47b2461df/lib/ansible/modules/network/nxos/_nxos_interface.py#L512-L515 and returns with an empty list.
The empty list is then used as have
in https://github.com/ansible/ansible/blob/b7ab8f9411267bed4eb4d5ba62698af47b2461df/lib/ansible/modules/network/nxos/_nxos_interface.py#L734
As have
is empty all objects in want
will be re-created in map_obj_to_commands
.
@jkrabbe 'nxos_interface' will get deprecated soon and will be replaced by 'nxos_interfaces'. This will be released in a couple of weeks. Requesting you to use 'nxos_interfaces' and let us know the behavior.
needs_info
@jkrabbe This issue is waiting for your response. Please respond or the issue will be closed.
WTF? QA? The new module is not even working with Ansible 2.9.1 for me. See #64526 Please let me know once a working Ansible version for nxos_interfaces is available.
Thank you very much for your interest in Ansible. This plugin is no longer maintained in this repository and has been migrated to https://github.com/ansible-collections/cisco.nxos
Please re-submit this issue in the above repository.
If you have further questions please stop by IRC or the mailing list:
SUMMARY
When adding port-channel interfaces through nxos_interface aggregate it breaks idempotency when additional port-channels are configured.
ISSUE TYPE
COMPONENT NAME
nxos_interface
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Ansible host:
NX-OS target system:
STEPS TO REPRODUCE
Then run following three commands:
EXPECTED RESULTS
On
first
run only PortChannel500 gets created. Onsecond
run only PortChannel501 gets created. Onthird
run only PortChannel502 gets created.ACTUAL RESULTS
The
first
run:Rerunning
first
run (=> idempotent):The
second
run. :bangbang: As you can see this also changes/creates the port-channel500 again. :bangbang:Rerunning
second
run (=> idempotent):The
third
run: :bangbang: As you can see this also changes/creates the port-channel500 and port-channel501 again. :bangbang:Rerunning
third
run (=> idempotent):