ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
787 stars 1.45k forks source link

Impossible to use module ssh_config on fedora linux 35 #3699

Closed Tsuna77 closed 11 months ago

Tsuna77 commented 2 years ago

Summary

Storm parsers not available. I try to install it in many ways but it was never found 😭

On the paste I try on python 3.8 but it's also crash on python 3.10 the default python on fedora 35

Issue Type

Bug Report

Component Name

ssh_config

Ansible Version

ansible [core 2.11.6] 
  config file = /home/********/Téléchargements/ansible-pc-integ/ansible.cfg
  configured module search path = ['/home/********/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/********/Téléchargements/ansible-pc-integ/virtualenv/lib/python3.8/site-packages/ansible
  ansible collection location = /home/********/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/********/Téléchargements/ansible-pc-integ/virtualenv/bin/ansible
  python version = 3.8.12 (default, Aug 30 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)]
  jinja version = 3.0.3
  libyaml = True

Community.general Version

# /home/*******/Téléchargements/ansible-pc-integ/virtualenv/lib/python3.8/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 3.8.1 

Configuration

ANSIBLE_NOCOWS(/home/********/Téléchargements/ansible-pc-integ/ansible.cfg) = True
CALLBACKS_ENABLED(/home/********/Téléchargements/ansible-pc-integ/ansible.cfg) = ['timer']
DEFAULT_HOST_LIST(/home/********/Téléchargements/ansible-pc-integ/ansible.cfg) = ['/home/********/Téléchargements/ansible-pc-integ/inventories/production']
DEFAULT_STDOUT_CALLBACK(/home/********/Téléchargements/ansible-pc-integ/ansible.cfg) = default
DISPLAY_SKIPPED_HOSTS(/home/********/Téléchargements/ansible-pc-integ/ansible.cfg) = False
INVENTORY_IGNORE_EXTS(/home/********/Téléchargements/ansible-pc-integ/ansible.cfg) = ['~', '.orig', '.bak', '.ini', '.cfg', '.retry', '.pyc', '.pyo', '.rpmnew', '.rpmsave']

OS / Environment

Fedora Linux 35 on VM (Hyper-V on Windows 10 21H1)

pip freeze of the virtualenv

$ pip freeze
ansible==4.8.0
ansible-core==2.11.6
bcrypt==3.2.0
cffi==1.15.0
click==8.0.3
cryptography==35.0.0
Flask==2.0.2
future==0.18.2
Glances==3.1.7
itsdangerous==2.0.1
Jinja2==3.0.3
MarkupSafe==2.0.1
packaging==21.2
paramiko==2.8.0
psutil==5.8.0
pycparser==2.21
PyNaCl==1.4.0
pyparsing==2.4.7
PyYAML==6.0
resolvelib==0.5.4
six==1.16.0
storm==0.25
stormssh==0.7.0
termcolor==1.1.0
Werkzeug==2.0.2

Steps to Reproduce

- name: "Configuration du proxy ssh pour github.com"
      community.general.ssh_config:
        host: github.com
        hostname: ssh.github.com
        identity_file: "~/.ssh/id_rsa"
        port: "22"
        proxycommand: "corkscrew {{ myproxy }} 8080 %h %p"
        state : present
        user: "{{ user.name }}"
      become: yes
      become_user: "{{ user.name }}"

Expected Results

ssh config file, updated

Actual Results

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'storm.parsers'
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (stormssh) on fedora's Python /home/********/Téléchargements/ansible-pc-integ/virtualenv/bin/python. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

Code of Conduct

ansibullbot commented 2 years ago

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

ansibullbot commented 2 years ago

cc @Akasurde @gaqzi click here for bot help

felixfontein commented 2 years ago

Did you install stormssh on the target machine and for the user the module is run with (or alternatively for root)?

You can for example use Ansible's pip module to install it, then you can be pretty sure it will use the correct pip on the correct machine.

Tsuna77 commented 2 years ago

if you have a look on the pip freeze (it's the pip with the python used by ansible, you can see storm and stormssh in it :(

Tsuna77 commented 2 years ago

the target machine is the same, I'm using this onsible in the target (localhost + connection local)

ansibullbot commented 1 year ago

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

russoz commented 1 year ago

hi @Tsuna77 I have just tested installing stormssh in Fedora 37. Given that Fedora 35 is EOL since December last year, do you still want to pursue this? TIA

needs_info

felixfontein commented 1 year ago

The module no longer depends on stormssh, we vendored that (https://github.com/ansible-collections/community.general/blob/main/plugins/module_utils/_stormssh.py).

russoz commented 1 year ago

Oh, I missed that. In that case, I suppose you should just close this issue. Will wait until the end of next week (21-22/Jul), then will close unless a compelling reason pops up during that period.

rricordeau commented 11 months ago

Thanks for your answers, I just see the close notification by email. I forget about this issue (2 years ago ^^)

I will try again later, cheers.