SUMMARY
gather facts fail on mds switch
The full traceback is:
Traceback (most recent call last):
File "/home/feisa/.ansible/tmp/ansible-local-7795104dglkzzy/ansible-tmp-1599779229.9795203-779516-214568281582338/AnsiballZ_nxos_facts.py", line 102, in
_ansiballz_main()
File "/home/feisa/.ansible/tmp/ansible-local-7795104dglkzzy/ansible-tmp-1599779229.9795203-779516-214568281582338/AnsiballZ_nxos_facts.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/feisa/.ansible/tmp/ansible-local-7795104dglkzzy/ansible-tmp-1599779229.9795203-779516-214568281582338/AnsiballZ_nxos_facts.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.network.nxos.nxos_facts', init_globals=None, run_name='main', alter_sys=True)
File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/modules/network/nxos/nxos_facts.py", line 239, in
File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/modules/network/nxos/nxos_facts.py", line 230, in main
File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/network/nxos/facts/facts.py", line 68, in get_facts
File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/network/common/facts/facts.py", line 105, in get_network_resources_facts
File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/network/nxos/facts/vlans/vlans.py", line 66, in populate_facts
File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/network/nxos/facts/vlans/vlans.py", line 46, in get_device_data
File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/connection.py", line 185, in rpc
ansible.module_utils.connection.ConnectionError: show vlan | json
^
% Invalid command at '^' marker.
la3-sanmc001#
fatal: [la3-sanmc001]: FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/libexec/platform-python"
},
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/home/feisa/.ansible/tmp/ansible-local-7795104dglkzzy/ansible-tmp-1599779229.9795203-779516-214568281582338/AnsiballZ_nxos_facts.py", line 102, in \n _ansiballz_main()\n File "/home/feisa/.ansible/tmp/ansible-local-7795104dglkzzy/ansible-tmp-1599779229.9795203-779516-214568281582338/AnsiballZ_nxos_facts.py", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/feisa/.ansible/tmp/ansible-local-7795104dglkzzy/ansible-tmp-1599779229.9795203-779516-214568281582338/AnsiballZ_nxos_facts.py", line 40, in invoke_module\n runpy.run_module(mod_name='ansible.modules.network.nxos.nxos_facts', init_globals=None, run_name='main', alter_sys=True)\n File "/usr/lib64/python3.6/runpy.py", line 205, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code\n mod_name, mod_spec, pkg_name, script_name)\n File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code\n exec(code, run_globals)\n File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/modules/network/nxos/nxos_facts.py", line 239, in \n File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/modules/network/nxos/nxos_facts.py", line 230, in main\n File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/network/nxos/facts/facts.py", line 68, in get_facts\n File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/network/common/facts/facts.py", line 105, in get_network_resources_facts\n File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/network/nxos/facts/vlans/vlans.py", line 66, in populate_facts\n File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/network/nxos/facts/vlans/vlans.py", line 46, in get_device_data\n File "/tmp/ansible_nxos_facts_payload_5yla6sqs/ansible_nxos_facts_payload.zip/ansible/module_utils/connection.py", line 185, in rpc\nansible.module_utils.connection.ConnectionError: show vlan | json\r\r\n ^\r\n% Invalid command at '^' marker.\r\n\rla3-sanmc001# \n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
ISSUE TYPE
COMPONENT NAME
cisco.nxos.nxos_facts
ANSIBLE VERSION
ansible 2.9.13
config file = /home/feisa/ansible-network/ansible.cfg
configured module search path = ['/home/feisa/ansible-network/library']
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible
python version = 3.6.8 (default, Dec 5 2019, 15:45:45) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
CONFIGURATION
OS / ENVIRONMENT
rhel8
STEPS TO REPRODUCE
EXPECTED RESULTS
ACTUAL RESULTS
This was supposed to be fixed in https://github.com/ansible-collections/cisco.nxos/issues/46
@feisacrabel i dont think this is related to #46 , this is specific to get_facts, its trying to run n7k related cmds (show vlan) which doesnt work on MDS, could you please run MDS modules without get_facts?
@srbharadwaj do you have a gather facts for mds?
@feisacrabel not implemented for mds, we can keep this bug as a placeholder to implement it
great, hopefully, this is straight forward. Happy to test. I'm migrating hundreds on roles to collections right now
@feisacrabel can you please give me the playbook u are using for recreating this issue?
This is a major enhancement, so considering it for future roadmap item.
its actually not, it works for the most part you just need to eliminate vlan collecting
Its slightly more complicated than that :)
@NilashishC this more like an enhancement or a feature request, so can you please add feature tag to this?