You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ ansible-playbook -i inventory.yml playbook.yml
PLAY RECAP **********************************************************************************************************************************************************
10.241.25.229 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
TASK [Test ce_switchport] *******************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'host'
fatal: [10.10.10.10]: FAILED! => {
"changed": false,
"rc": 1
}
MSG:
MODULE FAILURE
See stdout/stderr for the exact error
MODULE_STDERR:
Traceback (most recent call last):
File "/home/efrikin/.ansible/tmp/ansible-local-3549045k4_97muy/ansible-tmp-1634130356.5077596-3549060-79923218629944/AnsiballZ_ce_switchport.py", line 100, in<module>_ansiballz_main()
File "/home/efrikin/.ansible/tmp/ansible-local-3549045k4_97muy/ansible-tmp-1634130356.5077596-3549060-79923218629944/AnsiballZ_ce_switchport.py", line 92, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/efrikin/.ansible/tmp/ansible-local-3549045k4_97muy/ansible-tmp-1634130356.5077596-3549060-79923218629944/AnsiballZ_ce_switchport.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.ce_switchport', init_globals=dict(_module_fqn='ansible_collections.community.network.plugins.modules.ce_switchport', _modlib_path=modlib_path),
File "/usr/lib/python3.8/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 95, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_community.network.ce_switchport_payload_fj9kqakp/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 1020, in<module>
File "/tmp/ansible_community.network.ce_switchport_payload_fj9kqakp/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 1015, in main
File "/tmp/ansible_community.network.ce_switchport_payload_fj9kqakp/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 338, in __init__
KeyError: 'host'
PLAY RECAP **********************************************************************************************************************************************************
10.10.10.10 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
3. If take example from official documentation and set provider variable, then we will see following error:
ansible-playbook [core 2.11.3]
config file = /home/efrikin/INBOX/sw/ansible.cfg
configured module search path = ['/home/efrikin/INBOX/sw/library']
ansible python module location = /home/efrikin/INBOX/sw/venv/lib/python3.8/site-packages/ansible
ansible collection location = /home/efrikin/INBOX/sw/collections
executable location = /home/efrikin/INBOX/sw/venv/bin/ansible-playbook
python version = 3.8.0 (default, Feb 25 2021, 22:10:10) [GCC 8.4.0]
jinja version = 3.0.1
libyaml = False
Using /home/efrikin/INBOX/sw/ansible.cfg as config file
setting up inventory plugins
host_list declined parsing /home/efrikin/INBOX/sw/playbook.yml as it did not pass its verify_file() method
script declined parsing /home/efrikin/INBOX/sw/playbook.yml as it did not pass its verify_file() method
Parsed /home/efrikin/INBOX/sw/playbook.yml inventory source with yaml plugin
[WARNING]: Skipping plugin (/home/efrikin/INBOX/sw/venv/lib/python3.8/site-packages/ansible/plugins/connection/winrm.py) as it seems to be invalid: invalid syntax
(spawnbase.py, line 224)
Loading collection community.network from /home/efrikin/INBOX/sw/collections/ansible_collections/community/network
redirecting (type: callback) ansible.builtin.debug to ansible.posix.debug
Loading collection ansible.posix from /home/efrikin/INBOX/sw/venv/lib/python3.8/site-packages/ansible_collections/ansible/posix
redirecting (type: callback) ansible.builtin.debug to ansible.posix.debug
Loading callback plugin ansible.posix.debug of type stdout, v2.0 from /home/efrikin/INBOX/sw/venv/lib/python3.8/site-packages/ansible_collections/ansible/posix/plugins/callback/debug.py
Attempting to use 'default' callback.
Skipping callback 'default', as we already have a stdout callback.
Attempting to use 'junit' callback.
Attempting to use 'minimal' callback.
Skipping callback 'minimal', as we already have a stdout callback.
Attempting to use 'oneline' callback.
Skipping callback 'oneline', as we already have a stdout callback.
Attempting to use 'tree' callback.
PLAYBOOK: playbook.yml **********************************************************************************************************************************************
Positional arguments: playbook.yml
verbosity: 5
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
diff: True
inventory: ('/home/efrikin/INBOX/sw/playbook.yml',)
forks: 5
1 plays in playbook.yml
[WARNING]: Found variable using reserved name: connection
PLAY [sw] ***********************************************************************************************************************************************************
Overried ansible_python_interpreter: /home/efrikin/INBOX/sw/venv/bin/python for 10.10.10.10
Overried ansible_python_interpreter: /home/efrikin/INBOX/sw/venv/bin/python for 10.10.10.10
META: ran handlers
Overried ansible_python_interpreter: /home/efrikin/INBOX/sw/venv/bin/python for 10.10.10.10
Overried ansible_python_interpreter: /home/efrikin/INBOX/sw/venv/bin/python for 10.10.10.10
TASK [Test ce_switchport] *******************************************************************************************************************************************
task path: /home/efrikin/INBOX/sw/playbook.yml:44
Loading collection ansible.netcommon from /home/efrikin/INBOX/sw/collections/ansible_collections/ansible/netcommon
<10.10.10.10> attempting to start connection
<10.10.10.10> using connection plugin ansible.netcommon.netconf
Found ansible-connection at path /home/efrikin/INBOX/sw/venv/bin/ansible-connection
<10.10.10.10> local domain socket does not exist, starting it
<10.10.10.10> control socket path is /home/efrikin/.ansible/pc/184011d479
<10.10.10.10> Loading collection ansible.netcommon from /home/efrikin/INBOX/sw/collections/ansible_collections/ansible/netcommon
<10.10.10.10> Loading collection community.network from /home/efrikin/INBOX/sw/collections/ansible_collections/community/network
<10.10.10.10> local domain socket listeners started successfully
<10.10.10.10> loaded netconf plugin ansible_collections.community.network.plugins.netconf.ce from path /home/efrikin/INBOX/sw/collections/ansible_collections/community/network/plugins/netconf/ce.py for network_os community.network.ce
<10.10.10.10>
<10.10.10.10> local domain socket path is /home/efrikin/.ansible/pc/184011d479
<10.10.10.10> Using network group action community.network.ce for community.network.ce_switchport
<10.10.10.10> ANSIBLE_NETWORK_IMPORT_MODULES: disabled
<10.10.10.10> ANSIBLE_NETWORK_IMPORT_MODULES: module execution time may be extended
<10.10.10.10> ESTABLISH LOCAL CONNECTION FOR USER: efrikin
<10.10.10.10> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd `"&& mkdir "` echo /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921 `" && echo ansible-tmp-1634136461.9377387-3558283-4797428326921="` echo /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921 `" ) && sleep 0'
Including module_utils file ansible/__init__.py
Including module_utils file ansible/module_utils/__init__.py
Including module_utils file ansible/module_utils/basic.py
Including module_utils file ansible/module_utils/_text.py
Including module_utils file ansible/module_utils/common/_collections_compat.py
Including module_utils file ansible/module_utils/common/__init__.py
Including module_utils file ansible/module_utils/common/_json_compat.py
Including module_utils file ansible/module_utils/common/_utils.py
Including module_utils file ansible/module_utils/common/arg_spec.py
Including module_utils file ansible/module_utils/common/file.py
Including module_utils file ansible/module_utils/common/parameters.py
Including module_utils file ansible/module_utils/common/collections.py
Including module_utils file ansible/module_utils/common/process.py
Including module_utils file ansible/module_utils/common/sys_info.py
Including module_utils file ansible/module_utils/common/text/converters.py
Including module_utils file ansible/module_utils/common/text/__init__.py
Including module_utils file ansible/module_utils/common/text/formatters.py
Including module_utils file ansible/module_utils/common/validation.py
Including module_utils file ansible/module_utils/common/warnings.py
Including module_utils file ansible/module_utils/compat/selectors.py
Including module_utils file ansible/module_utils/compat/__init__.py
Including module_utils file ansible/module_utils/compat/_selectors2.py
Including module_utils file ansible/module_utils/compat/selinux.py
Including module_utils file ansible/module_utils/distro/__init__.py
Including module_utils file ansible/module_utils/distro/_distro.py
Including module_utils file ansible/module_utils/errors.py
Including module_utils file ansible/module_utils/parsing/convert_bool.py
Including module_utils file ansible/module_utils/parsing/__init__.py
Including module_utils file ansible/module_utils/pycompat24.py
Including module_utils file ansible/module_utils/six/__init__.py
Including module_utils file ansible_collections/community/network/plugins/module_utils/network/cloudengine/ce.py
Including module_utils file ansible/module_utils/connection.py
Including module_utils file ansible/module_utils/common/json.py
Including module_utils file ansible_collections/__init__.py
Including module_utils file ansible_collections/ansible/netcommon/plugins/module_utils/network/common/netconf.py
Including module_utils file ansible_collections/ansible/__init__.py
Including module_utils file ansible_collections/ansible/netcommon/__init__.py
Including module_utils file ansible_collections/ansible/netcommon/plugins/__init__.py
Including module_utils file ansible_collections/ansible/netcommon/plugins/module_utils/__init__.py
Including module_utils file ansible_collections/ansible/netcommon/plugins/module_utils/network/__init__.py
Including module_utils file ansible_collections/ansible/netcommon/plugins/module_utils/network/common/__init__.py
Including module_utils file ansible_collections/ansible/netcommon/plugins/module_utils/network/common/utils.py
Including module_utils file ansible/module_utils/common/network.py
Including module_utils file ansible_collections/community/__init__.py
Including module_utils file ansible_collections/community/network/__init__.py
Including module_utils file ansible_collections/community/network/plugins/__init__.py
Including module_utils file ansible_collections/community/network/plugins/module_utils/__init__.py
Including module_utils file ansible_collections/community/network/plugins/module_utils/network/__init__.py
Including module_utils file ansible_collections/community/network/plugins/module_utils/network/cloudengine/__init__.py
Using module file /home/efrikin/INBOX/sw/collections/ansible_collections/community/network/plugins/modules/ce_switchport.py
<10.10.10.10> PUT /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/tmpelsoscwr TO /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py
<10.10.10.10> EXEC /bin/sh -c 'chmod u+x /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/ /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py && sleep 0'
<10.10.10.10> EXEC /bin/sh -c '/home/efrikin/INBOX/sw/venv/bin/python /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py && sleep 0'
<10.10.10.10> EXEC /bin/sh -c 'rm -f -r /home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
Traceback (most recent call last):
File "/home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py", line 100, in <module>
_ansiballz_main()
File "/home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py", line 92, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.ce_switchport', init_globals=dict(_module_fqn='ansible_collections.community.network.plugins.modules.ce_switchport', _modlib_path=modlib_path),
File "/usr/lib/python3.8/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 95, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_community.network.ce_switchport_payload_gux8f2fe/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 1020, in <module>
File "/tmp/ansible_community.network.ce_switchport_payload_gux8f2fe/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 1015, in main
File "/tmp/ansible_community.network.ce_switchport_payload_gux8f2fe/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 338, in __init__
KeyError: 'host'
fatal: [10.10.10.10]: FAILED! => {
"changed": false,
"rc": 1
}
MSG:
MODULE FAILURE
See stdout/stderr for the exact error
MODULE_STDERR:
Traceback (most recent call last):
File "/home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py", line 100, in <module>
_ansiballz_main()
File "/home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py", line 92, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/efrikin/.ansible/tmp/ansible-local-3558271odn3rxzd/ansible-tmp-1634136461.9377387-3558283-4797428326921/AnsiballZ_ce_switchport.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.ce_switchport', init_globals=dict(_module_fqn='ansible_collections.community.network.plugins.modules.ce_switchport', _modlib_path=modlib_path),
File "/usr/lib/python3.8/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.8/runpy.py", line 95, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.8/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_community.network.ce_switchport_payload_gux8f2fe/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 1020, in <module>
File "/tmp/ansible_community.network.ce_switchport_payload_gux8f2fe/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 1015, in main
File "/tmp/ansible_community.network.ce_switchport_payload_gux8f2fe/ansible_community.network.ce_switchport_payload.zip/ansible_collections/community/network/plugins/modules/ce_switchport.py", line 338, in __init__
KeyError: 'host'
to retry, use: --limit @/home/efrikin/.ansible/retry/playbook.retry
PLAY RECAP **********************************************************************************************************************************************************
10.10.10.10 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
The text was updated successfully, but these errors were encountered:
SUMMARY
There is a problem with
ce_switchport
module.Similar issue was already in #137, but not solved yet.
This problem affecting work
ce_switchport
.ISSUE TYPE
COMPONENT NAME
plugins/modules/network/cloudengine/ce_switchport.py
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
ALL VERSIONS
STEPS TO REPRODUCE
We have researched this problem and found following:
1. If launch ansible module as-is, then we will see error:
2. We need define connection type:
3. If take example from official documentation and set provider variable, then we will see following error:
4. If define
ansible_connection: ansible.netcommon.netconf
and retry use together with provider, then we will see following message:5. After removing entries in the ce_switchport module:
From log above we can see, that in invocation.module_args.provider parameter undefined and not was use.
EXPECTED RESULTS
10.10.10.10 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: