Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nmcli.py throws error on CentOS 8-stream #70906

Closed
inflatador opened this issue Jul 26, 2020 · 2 comments
Closed

nmcli.py throws error on CentOS 8-stream #70906

inflatador opened this issue Jul 26, 2020 · 2 comments
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. collection:community.general collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md net_tools Net-tools category python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.

Comments

@inflatador
Copy link

SUMMARY

Can't create bridge interface with nmcli

ISSUE TYPE
  • Bug Report
COMPONENT NAME

nmcli

ANSIBLE VERSION
ansible 2.9.11
  config file = None
  configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = ~/venvs/P3/lib/python3.6/site-packages/ansible
  executable location = ~/venvs/P3/bin/ansible
  python version = 3.6.10 (default, Dec 21 2019, 11:40:03) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)]
CONFIGURATION
(returns nothing)
OS / ENVIRONMENT

Running from: Mac OS X virtualenv, pip 20.1.1 installed ansible 2.9.11
Connecting to: CentOS 8-stream
cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)
python3 --version
Python 3.6.8

STEPS TO REPRODUCE

run a playbook using nmcli module

---

- name: verify bridge is present
  nmcli:
    type: bridge
    conn_name: labbr0
    state: present

EXPECTED RESULTS

Bridge created

ACTUAL RESULTS
Traceback (most recent call last):
  File "/home/user/.ansible/tmp/ansible-tmp-1595782089.741004-36751-28759087993374/AnsiballZ_nmcli.py", line 102, in <module>
    _ansiballz_main()
  File "/home/user/.ansible/tmp/ansible-tmp-1595782089.741004-36751-28759087993374/AnsiballZ_nmcli.py", line 94, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/user/.ansible/tmp/ansible-tmp-1595782089.741004-36751-28759087993374/AnsiballZ_nmcli.py", line 40, in invoke_module
    runpy.run_module(mod_name='ansible.modules.net_tools.nmcli', 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_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/modules/net_tools/nmcli.py", line 1557, in <module>
  File "/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/modules/net_tools/nmcli.py", line 1540, in main
  File "/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/modules/net_tools/nmcli.py", line 1396, in create_connection
  File "/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/modules/net_tools/nmcli.py", line 690, in execute_command
  File "/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/module_utils/basic.py", line 2502, in run_command
  File "/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/module_utils/basic.py", line 2502, in <listcomp>
  File "/usr/lib64/python3.6/posixpath.py", line 288, in expandvars
    path = os.fspath(path)
TypeError: expected str, bytes or os.PathLike object, not int
fatal: [linuxhost]: FAILED! => {
    "changed": false,
    "module_stderr": "OpenSSH_7.8p1, LibreSSL 2.6.2\r\ndebug1: Reading configuration data /Users/user/.ssh/config\r\ndebug1: /Users/user/.ssh/config line 3: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 48: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 192.168.55.209 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: m                module.exit_json(changed=True)
ux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 36721\r\ndebug3: mux_client_request_session: session request sent\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 1\r\nShared connection to 192.168.55.209 closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1595782089.741004-36751-28759087993374/AnsiballZ_nmcli.py\", line 102, in <module>\r\n    _ansiballz_main()\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1595782089.741004-36751-28759087993374/AnsiballZ_nmcli.py\", line 94, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/home/user/.ansible/tmp/ansible-tmp-1595782089.741004-36751-28759087993374/AnsiballZ_nmcli.py\", line 40, in invoke_module\r\n    runpy.run_module(mod_name='ansible.modules.net_tools.nmcli', init_globals=None, run_name='__main__', alter_sys=True)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n    mod_name, mod_spec, pkg_name, script_name)\r\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/modules/net_tools/nmcli.py\", line 1557, in <module>\r\n  File \"/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/modules/net_tools/nmcli.py\", line 1540, in main\r\n  File \"/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/modules/net_tools/nmcli.py\", line 1396, in create_connection\r\n  File \"/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/modules/net_tools/nmcli.py\", line 690, in execute_command\r\n  File \"/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/module_utils/basic.py\", line 2502, in run_command\r\n  File \"/tmp/ansible_nmcli_payload_8z_asoku/ansible_nmcli_payload.zip/ansible/module_utils/basic.py\", line 2502, in <listcomp>\r\n  File \"/usr/lib64/python3.6/posixpath.py\", line 288, in expandvars\r\n    path = os.fspath(path)\r\nTypeError: expected str, bytes or os.PathLike object, not int\r\n",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}

@ansibot
Copy link
Contributor

ansibot commented Jul 26, 2020

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibot ansibot added affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. collection Related to Ansible Collections work collection:community.general module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md needs_triage Needs a first human triage before being processed. net_tools Net-tools category python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback. labels Jul 26, 2020
@Akasurde
Copy link
Member

Thank you very much for your interest in Ansible. This plugin/module is no longer maintained in this repository and has been migrated to https://github.com/ansible-collections/community.general

Migrated this issue in the above repository - ansible-collections/community.general#697.

If you have further questions please stop by IRC or the mailing list:

@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Aug 6, 2020
@ansible ansible locked and limited conversation to collaborators Aug 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.9 This issue/PR affects Ansible v2.9 bug This issue/PR relates to a bug. collection:community.general collection Related to Ansible Collections work module This issue/PR relates to a module. needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md net_tools Net-tools category python3 support:community This issue/PR relates to code supported by the Ansible community. traceback This issue/PR includes a traceback.
Projects
None yet
Development

No branches or pull requests

4 participants