Open artemiysp opened 3 years ago
CC @QijunPan
@artemiysp: Greetings! Thanks for taking the time to open this issue. In order for the community to handle your issue effectively, we need a bit more information.
Here are the items we could not find in your description:
Please set the description of this issue with this template: https://raw.githubusercontent.com/ansible/ansible/devel/.github/ISSUE_TEMPLATE/bug_report.md
Hello.
• ansible version
artemiy@ansible02:~/project04$ ansible --version ansible 2.10.2 config file = /home/artemiy/project04/ansible.cfg configured module search path = ['/home/artemiy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/artemiy/.local/lib/python3.8/site-packages/ansible executable location = /home/artemiy/.local/bin/ansible python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] artemiy@ansible02:~/project04$
• component name
Collection Version
community.network 1.2.0
artemiy@ansible02:~/project04$
After upgrade from ansible 2.9.6 to 2.10.2, I start migrate from module «ce*» to «community.network.ce*» 1 module run with error: community.network.ce_switchport
PLAY [?????????? VRF ????????? Huawei] ***
TASK [ce_interface_trunk : ????????? Trunk] **
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'host'
failed: [10.31.71.64] (item={'interface': '10GE1/0/21', 'trunk_vlans': '252-253'}) => {"ansible_loop_var": "item", "changed": false, "item": {"interface": "10GE1/0/21", "trunk_vlans": "252-253"}, "module_stderr": "Traceback (most recent call last):\n File \"/home/artemiy/.ansible/tmp/ansible-local-77503wf2uv48s/ansible-tmp-1603641023.6846008-77507-158520318945482/AnsiballZ_ce_switchport.py\", line 102, in
PLAY RECAP *** 10.31.71.64 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Bug Report The component: community.network.ce_switchport Try to get udefined keys:
# host info
self.host = self.module.params['host']
self.username = self.module.params['username']
self.port = self.module.params['port']
=== DEBUG output === artemiy@ansible02:~/project04$ ./run ansible-playbook 2.10.2 config file = /home/artemiy/project04/ansible.cfg configured module search path = ['/home/artemiy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/artemiy/.local/lib/python3.8/site-packages/ansible executable location = /home/artemiy/.local/bin/ansible-playbook python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0] Using /home/artemiy/project04/ansible.cfg as config file setting up inventory plugins host_list declined parsing /home/artemiy/project04/inven2.ini as it did not pass its verify_file() method script declined parsing /home/artemiy/project04/inven2.ini as it did not pass its verify_file() method auto declined parsing /home/artemiy/project04/inven2.ini as it did not pass its verify_file() method yaml declined parsing /home/artemiy/project04/inven2.ini as it did not pass its verify_file() method Parsed /home/artemiy/project04/inven2.ini inventory source with ini plugin Loading collection community.network from /home/artemiy/.ansible/collections/ansible_collections/community/network Loading callback plugin default of type stdout, v2.0 from /home/artemiy/.local/lib/python3.8/site-packages/ansible/plugins/callback/default.py
PLAYBOOK: test_ce.yaml *** Positional arguments: test_ce.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/home/artemiy/project04/inven2.ini',) forks: 5 1 plays in test_ce.yaml
PLAY [Добавление VRF Настройка Huawei] *** META: ran handlers
TASK [ce_interface_trunk : Настройка Trunk] **
task path: /home/artemiy/project04/roles/ce_interface_trunk/tasks/main.yml:4
redirecting (type: connection) ansible.builtin.netconf to ansible.netcommon.netconf
Loading collection ansible.netcommon from /home/artemiy/.ansible/collections/ansible_collections/ansible/netcommon
redirecting (type: netconf) ansible.builtin.ce to community.network.ce
<10.31.71.64> attempting to start connection
<10.31.71.64> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /home/artemiy/.local/bin/ansible-connection
<10.31.71.64> local domain socket does not exist, starting it
<10.31.71.64> control socket path is /home/artemiy/.ansible/pc/c3c7dd17c3
<10.31.71.64> redirecting (type: connection) ansible.builtin.netconf to ansible.netcommon.netconf
<10.31.71.64> Loading collection ansible.netcommon from /home/artemiy/.ansible/collections/ansible_collections/ansible/netcommon
<10.31.71.64> redirecting (type: netconf) ansible.builtin.ce to community.network.ce
<10.31.71.64> Loading collection community.network from /home/artemiy/.ansible/collections/ansible_collections/community/network
<10.31.71.64> local domain socket listeners started successfully
<10.31.71.64> loaded netconf plugin ansible_collections.community.network.plugins.netconf.ce from path /home/artemiy/.ansible/collections/ansible_collections/community/network/plugins/netconf/ce.py for network_os ce
<10.31.71.64>
<10.31.71.64> local domain socket path is /home/artemiy/.ansible/pc/c3c7dd17c3
<10.31.71.64> ESTABLISH LOCAL CONNECTION FOR USER: artemiy
<10.31.71.64> EXEC /bin/sh -c '( umask 77 && mkdir -p "echo /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x
"&& mkdir "echo /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/ansible-tmp-1603641425.3165808-78010-47206849119971
" && echo ansible-tmp-1603641425.3165808-78010-47206849119971="echo /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/ansible-tmp-1603641425.3165808-78010-47206849119971
" ) && sleep 0'
Using module file /home/artemiy/.ansible/collections/ansible_collections/community/network/plugins/modules/ce_switchport.py
<10.31.71.64> PUT /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/tmpn8gzlflj TO /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/ansible-tmp-1603641425.3165808-78010-47206849119971/AnsiballZ_ce_switchport.py
<10.31.71.64> EXEC /bin/sh -c 'chmod u+x /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/ansible-tmp-1603641425.3165808-78010-47206849119971/ /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/ansible-tmp-1603641425.3165808-78010-47206849119971/AnsiballZ_ce_switchport.py && sleep 0'
<10.31.71.64> EXEC /bin/sh -c '/usr/bin/python3 /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/ansible-tmp-1603641425.3165808-78010-47206849119971/AnsiballZ_ce_switchport.py && sleep 0'
<10.31.71.64> EXEC /bin/sh -c 'rm -f -r /home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/ansible-tmp-1603641425.3165808-78010-47206849119971/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
File "/home/artemiy/.ansible/tmp/ansible-local-780051aboi85x/ansible-tmp-1603641425.3165808-78010-47206849119971/AnsiballZ_ce_switchport.py", line 102, in
PLAY RECAP *** 10.31.71.64 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
community.network.ce_switchport /home/artemiy/.ansible/collections/ansible_collections/community/network/plugins/modules/network/cloudengine/ce_switchport.py
ansible 2.10.2
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/artemiy/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/artemiy/.local/lib/python3.8/site-packages/ansible
executable location = /home/artemiy/.local/bin/ansible
python version = 3.8.5 (default, Jul 28 2020, 12:59:40) [GCC 9.3.0]
artemiy@ansible02:~/project04$ ansible-config dump --only-changed
DEFAULT_HOST_LIST(/home/artemiy/project04/ansible.cfg) = ['/home/artemiy/project04/inven2.ini']
INTERPRETER_PYTHON(/home/artemiy/project04/ansible.cfg) = /usr/bin/python3
artemiy@ansible02:~/project04$
artemiy@ansible02:~/project04$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal artemiy@ansible02:~/project04$
cc @TommyLike @edisonxiang @freesky-edward @hwDCN @niuzhenguo @xuxiaowei0512 @yanzhangi @zengchen1024 @zhongjun2 click here for bot help
Error with module after update from ansible 2.9.6 to 2.10.2. Error with module: community.network.ce_switchport
Error output failed: [10.31.71.61] (item={'interface': '100GE1/0/1', 'trunk_vlans': '252,253,254,255,149'}) => {"ansible_loop_var": "item", "changed": false, "item": {"interface": "100GE1/0/1", "trunk_vlans": "252,253,254,255,149"}, "module_stderr": "Traceback (most recent call last):\n File \"/home/artemiy/.ansible/tmp/ansible-local-42624rv38a1vw/ansible-tmp-1603621187.0906644-43168-44873429657680/AnsiballZ_ce_switchport.py\", line 102, in\n _ansiballz_main()\n File \"/home/artemiy/.ansible/tmp/ansible-local-42624rv38a1vw/ansible-tmp-1603621187.0906644-43168-44873429657680/AnsiballZ_ce_switchport.py\", line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/home/artemiy/.ansible/tmp/ansible-local-42624rv38a1vw/ansible-tmp-1603621187.0906644-43168-44873429657680/AnsiballZ_ce_switchport.py\", line 40, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.ce_switchport', init_globals=None, run_name='main', alter_sys=True)\n File \"/usr/lib/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_community.network.ce_switchport_payload_k94s148v/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py\", line 997, in \n File \"/tmp/ansible_community.network.ce_switchport_payload_k94s148v/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py\", line 992, in main\n File \"/tmp/ansible_community.network.ce_switchport_payload_k94s148v/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py\", line 338, in init\nKeyError: 'host'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'host'
How to fix error: Comment 3 lines: at "ce_switchport.py":
host info
(lines 338 - 340) /home/artemiy/.ansible/collections/ansible_collections/community/network/plugins/modules/network/cloudengine/ce_switchport.py