CiscoDevNet / ansible-aci

Cisco ACI Ansible Collection
https://galaxy.ansible.com/cisco/aci
GNU General Public License v3.0
143 stars 97 forks source link

Cisco ACI: An exception occurred during task execution #652

Closed MeghnathShinde closed 6 months ago

MeghnathShinde commented 6 months ago

[user01@centos7-tools1 dCloud_ACI_Automation]$ ansible-playbook newTenant.yaml -vvv ansible-playbook 2.9.27 config file = /etc/ansible/ansible.cfg configured module search path = [u'/home/user01/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules'] ansible python module location = /usr/lib/python2.7/site-packages/ansible executable location = /usr/bin/ansible-playbook python version = 2.7.5 (default, Apr 9 2019, 14:30:50) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] Using /etc/ansible/ansible.cfg as config file host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method Parsed /etc/ansible/hosts inventory source with ini plugin Skipping callback 'actionable', as we already have a stdout callback. Skipping callback 'counter_enabled', as we already have a stdout callback. Skipping callback 'debug', as we already have a stdout callback. Skipping callback 'dense', as we already have a stdout callback. Skipping callback 'dense', as we already have a stdout callback. Skipping callback 'full_skip', as we already have a stdout callback. Skipping callback 'json', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'null', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. Skipping callback 'selective', as we already have a stdout callback. Skipping callback 'skippy', as we already have a stdout callback. Skipping callback 'stderr', as we already have a stdout callback. Skipping callback 'unixy', as we already have a stdout callback. Skipping callback 'yaml', as we already have a stdout callback.

PLAYBOOK: newTenant.yaml ** 1 plays in newTenant.yaml

PLAY [Create a complete tenant on ACI using hierarchical variables] *** META: ran handlers

TASK [create tenant on ACI using aci_tenant module] *** task path: /home/user01/dCloud_ACI_Automation/newTenant.yaml:31

ESTABLISH LOCAL CONNECTION FOR USER: user01 EXEC /bin/sh -c 'echo ~user01 && sleep 0' EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/user01/.ansible/tmp `"&& mkdir "` echo /home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936 `" && echo ansible-tmp-1714708900.97-13957-36726462182936="` echo /home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936 `" ) && sleep 0' Using module file /home/user01/.ansible/collections/ansible_collections/cisco/aci/plugins/modules/aci_tenant.py PUT /home/user01/.ansible/tmp/ansible-local-13948MOJY85/tmpE4zX7h TO /home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py EXEC /bin/sh -c 'chmod u+x /home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/ /home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py && sleep 0' EXEC /bin/sh -c '/usr/bin/python2 /home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py && sleep 0' EXEC /bin/sh -c 'rm -f -r /home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/ > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py", line 102, in _ansiballz_main() File "/home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py", line 94, in _ansiballz_main invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS) File "/home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py", line 40, in invoke_module runpy.run_module(mod_name='ansible_collections.cisco.aci.plugins.modules.aci_tenant', init_globals=None, run_name='__main__', alter_sys=True) File "/usr/lib64/python2.7/runpy.py", line 176, in run_module fname, loader, pkg_name) File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code mod_name, mod_fname, mod_loader, pkg_name) File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code exec code in run_globals File "/tmp/ansible_cisco.aci.aci_tenant_payload_txS72y/ansible_cisco.aci.aci_tenant_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_tenant.py", line 264, in File "/tmp/ansible_cisco.aci.aci_tenant_payload_txS72y/ansible_cisco.aci.aci_tenant_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_tenant.py", line 232, in main File "/tmp/ansible_cisco.aci.aci_tenant_payload_txS72y/ansible_cisco.aci.aci_tenant_payload.zip/ansible_collections/cisco/aci/plugins/module_utils/aci.py", line 444, in __init__ AttributeError: 'str' object has no attribute 'format_map' fatal: [apic1.dcloud.cisco.com -> localhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py\", line 102, in \n _ansiballz_main()\n File \"/home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/user01/.ansible/tmp/ansible-tmp-1714708900.97-13957-36726462182936/AnsiballZ_aci_tenant.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.cisco.aci.plugins.modules.aci_tenant', init_globals=None, run_name='__main__', alter_sys=True)\n File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module\n fname, loader, pkg_name)\n File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code\n mod_name, mod_fname, mod_loader, pkg_name)\n File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\n exec code in run_globals\n File \"/tmp/ansible_cisco.aci.aci_tenant_payload_txS72y/ansible_cisco.aci.aci_tenant_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_tenant.py\", line 264, in \n File \"/tmp/ansible_cisco.aci.aci_tenant_payload_txS72y/ansible_cisco.aci.aci_tenant_payload.zip/ansible_collections/cisco/aci/plugins/modules/aci_tenant.py\", line 232, in main\n File \"/tmp/ansible_cisco.aci.aci_tenant_payload_txS72y/ansible_cisco.aci.aci_tenant_payload.zip/ansible_collections/cisco/aci/plugins/module_utils/aci.py\", line 444, in __init__\nAttributeError: 'str' object has no attribute 'format_map'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } PLAY RECAP ******************************************************************************************************************************************************************** apic1.dcloud.cisco.com : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 [user01@centos7-tools1 dCloud_ACI_Automation]$
akinross commented 6 months ago

Hi @MeghnathShinde,

Is there a reason to be running python 2.7.5 (end of life)?

Could you retry with a version 3.2 or higher of python, preferably 3.9+?

See also, https://github.com/CiscoDevNet/ansible-aci/issues/651 for additional information on format_map() function.

Kind regards,

Akini

akinross commented 6 months ago

Hi @MeghnathShinde, were you able to resolve the issue by using a higher python version?

MeghnathShinde commented 6 months ago

Yes Akini, Issue resolved post upgrading python. Thanks for your support.