Open VerticalMalek opened 1 year ago
@VerticalMalek hi, thanks for reporting the issue!
@f-bor hi, could you please as an author take a look?
Had a similar issue. You have to set become: yes to view running-config:
---
- name: Get Edgeswitch Info
hosts: all
gather_facts: no
connection: network_cli
vars:
ansible_network_os: edgeswitch
ansible_host_key_checking: false
tasks:
- name: Get Facts
community.network.edgeswitch_facts:
gather_subset:
- config
register: output
become: yes
- name: Show Info
debug:
msg: "{{ output }}"
the module author doesn't respond, so if anyone wants to fix this themselves, here's the quick start guide.
What about after setting ansible_become_pass to ubnt ?
@Andersson007 Is there a way to document a "full example" somewhere ?
Doc in [1] in fine but settings like ansible_become or ansible_become_method are (for good reasons, certainly) omitted there.
@Andersson007 Is there a way to document a "full example" somewhere ?
Doc in [1] in fine but settings like ansible_become or ansible_become_method are (for good reasons, certainly) omitted there.
@oza4h07 if it's not too big and its presence is necessary (i.e. make users' life much easier), i think you can put it in the module docs in the EXAMPLES section. It can be, say, a new - block:
or you can override the whole examples's content
become
command actually helped. Would be great to have that in the documentation as it's not anywhere in examples section
feel free to submit a PR, folks
SUMMARY
While trying to use edgeswitch_facts module it won't return back data which I requested (it shows me an error which is mentioned bellow)
ISSUE TYPE
COMPONENT NAME
edgeswitch_facts ansible_network_os = edgeswitch
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Proxmox, there is Debian VM where ansible is installed
STEPS TO REPRODUCE
(I'm on root user)
ansible-playbook -i hosts edge.yaml -vvvv
EXPECTED RESULTS
Getting info which i requested from Edgeswitch
ACTUAL RESULTS
ansible-playbook [core 2.12.10] config file = /root/ansible.cfg configured module search path = ['/root/.ansible/plugins/modules', '/usr/share /ansible/plugins/modules'] ansible python module location = /usr/lib/python3/dist-packages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/co llections executable location = /usr/bin/ansible-playbook python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] jinja version = 2.11.3 libyaml = True Using /root/ansible.cfg as config file host_list declined parsing /root/hosts as it did not pass its verify_file() meth od script declined parsing /root/hosts as it did not pass its verify_file() method auto declined parsing /root/hosts as it did not pass its verify_file() method Parsed /root/hosts inventory source with ini plugin /usr/lib/python3/dist-packages/requests/init.py:87: RequestsDependencyWarnin g: urllib3 (1.26.5) or chardet (5.1.0) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported " Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback.
PLAYBOOK: edge.yaml **** 1 plays in edge.yaml
PLAY [EdgeSwitch test] *****
TASK [Gathering Facts] ***** task path: /root/edge.yaml:1 redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon. network_cli redirecting (type: terminal) ansible.builtin.edgeswitch to community.network.edg eswitch redirecting (type: cliconf) ansible.builtin.edgeswitch to community.network.edge switch <10.10.10.110> ESTABLISH LOCAL CONNECTION FOR USER: root <10.10.10.110> EXEC /bin/sh -c '( umask 77 && mkdir -p "
echo /root/.ansible/tmp/ansible-local-14944be9pkup2
"&& mkdir "echo /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832380.6743455-14948-242306386353140
" && echo ansible-tmp-1677832380.6743455-14948-242306386353140="echo /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832380.6743455-14948-242306386353140
" ) && sleep 0' Using module file /usr/lib/python3/dist-packages/ansible/modules/setup.py <10.10.10.110> PUT /root/.ansible/tmp/ansible-local-14944be9pkup2/tmpffypw2ea TO /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832380.6743455-14948-242306386353140/AnsiballZ_setup.py <10.10.10.110> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832380.6743455-14948-242306386353140/ /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832380.6743455-14948-242306386353140/AnsiballZ_setup.py && sleep 0' <10.10.10.110> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832380.6743455-14948-242306386353140/AnsiballZ_setup.py && sleep 0' <10.10.10.110> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832380.6743455-14948-242306386353140/ > /dev/null 2>&1 && sleep 0' ok: [10.10.10.110] META: ran handlersTASK [running config] ** task path: /root/edge.yaml:6 redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli redirecting (type: terminal) ansible.builtin.edgeswitch to community.network.edgeswitch redirecting (type: cliconf) ansible.builtin.edgeswitch to community.network.edgeswitch <10.10.10.110> ESTABLISH LOCAL CONNECTION FOR USER: root <10.10.10.110> EXEC /bin/sh -c '( umask 77 && mkdir -p "
_ansiballz_main()
File "/root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py", line 99, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py", line 47, in invoke_module
runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.edgeswitch_facts', init_globals=dict(_module_fqn='ansible_collections.community.network.plugins.modules.edgeswitch_facts', _modlib_path=modlib_path),
File "/usr/lib/python3.9/runpy.py", line 210, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible_collections/community/network/plugins/modules/edgeswitch_facts.py", line 283, in
File "/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible_collections/community/network/plugins/modules/edgeswitch_facts.py", line 279, in main
File "/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible/module_utils/basic.py", line 1519, in exit_json
File "/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible/module_utils/basic.py", line 1512, in _return_formatted
File "/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible/module_utils/common/parameters.py", line 890, in remove_values
File "/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible/module_utils/common/parameters.py", line 461, in _remove_values_conditions
TypeError: Value of unknown type: <class 'ansible.errors.AnsibleConnectionFailure'>, show running-config
^
% Invalid input detected at '^' marker.
echo /root/.ansible/tmp/ansible-local-14944be9pkup2
"&& mkdir "echo /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201
" && echo ansible-tmp-1677832382.5975838-14998-101865756239201="echo /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201
" ) && sleep 0' Using module file /root/.ansible/collections/ansible_collections/community/network/plugins/modules/edgeswitch_facts.py <10.10.10.110> PUT /root/.ansible/tmp/ansible-local-14944be9pkup2/tmpl_2mghgc TO /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py <10.10.10.110> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/ /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py && sleep 0' <10.10.10.110> EXEC /bin/sh -c '/usr/bin/python3 /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py && sleep 0' <10.10.10.110> EXEC /bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/ > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py", line 107, in(UBNT EdgeSwitch) > fatal: [10.10.10.110]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py\", line 107, in\n _ansiballz_main()\n File \"/root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py\", line 99, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \"/root/.ansible/tmp/ansible-local-14944be9pkup2/ansible-tmp-1677832382.5975838-14998-101865756239201/AnsiballZ_edgeswitch_facts.py\", line 47, in invoke_module\n runpy.run_module(mod_name='ansible_collections.community.network.plugins.modules.edgeswitch_facts', init_globals=dict(_module_fqn='ansible_collections.community.network.plugins.modules.edgeswitch_facts', _modlib_path=modlib_path),\n File \"/usr/lib/python3.9/runpy.py\", line 210, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib/python3.9/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib/python3.9/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible_collections/community/network/plugins/modules/edgeswitch_facts.py\", line 283, in \n File \"/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible_collections/community/network/plugins/modules/edgeswitch_facts.py\", line 279, in main\n File \"/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible/module_utils/basic.py\", line 1519, in exit_json\n File \"/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible/module_utils/basic.py\", line 1512, in _return_formatted\n File \"/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible/module_utils/common/parameters.py\", line 890, in remove_values\n File \"/tmp/ansible_community.network.edgeswitch_facts_payload_zfpfnu9c/ansible_community.network.edgeswitch_facts_payload.zip/ansible/module_utils/common/parameters.py\", line 461, in _remove_values_conditions\nTypeError: Value of unknown type: <class 'ansible.errors.AnsibleConnectionFailure'>, show running-config\r\n ^\r\n% Invalid input detected at '^' marker.\r\n\r\n(UBNT EdgeSwitch) >\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}
PLAY RECAP ***** 10.10.10.110 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0