community.general.ssh_config: ModuleNotFoundError: No module named 'storm'

I’m doing this:

  • name: Add Bitbucket in the SSH configuration
    community.general.ssh_config:
    user: “{{ jenkins_user }}”
    host: bitbucket
    remote_user: git
    hostname: “{{ bitbucket_hostname }}”
    port: ‘7999’
    identity_file: “/home/{{ jenkins_user }}/.ssh/{{ ssh_private_key }}”
    state: present

I get this error:

amazon-ebs: TASK [Add Bitbucket in the SSH configuration] **********************************
amazon-ebs: Friday 16 April 2021 14:35:03 +0200 (0:00:00.599) 0:17:50.265 **********
amazon-ebs: An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named ‘storm’
amazon-ebs: fatal: [default]: FAILED! => {“changed”: false, “msg”: “Failed to import the required Python library (stormssh) on ip-172-31-4-198’s Python /usr/bin/python3. 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”}

I already did

pip install storm

Can you please check if Python used by Ansible is same as pip environment?

As you are having python version 3 so try to install using pip3 install storm.
Well the error says that u are using storm as a module but in ansible there’s no such.

Btw, the package name is “stormssh” not “storm”

Storm - Storm is an Object Relational Mapper for Python developed at Canonical.
Stormssh - Management commands to ssh config files.

Also asked on Stack Overflow and the answer there came on Friday afternoon.

The answer is:
Do pip install stormssh on the remote machine just before doing the ssh config.

However for some reason the ssh config file was never written so in the end I gave up and I just hard linked my key file to id_rsa, which is one of the default filenames that ssh will automatically try