ansible-collections/ibm.spectrum_virtualize

Modules fail on Red Hat Enterprise Linux 8 as python-paramiko no longer available

robinsg opened this issue · 6 comments

SUMMARY

When running a task with any of the SV modules error occurs:

"paramiko is not installed"

ISSUE

After reviewing the Red Hat site it states that the python-paramiko packages are no longer part of the RHEL distribution.

Running python3 -m pip install paramiko fails with many dependency issues.

The Red Hat site here suggest using python virtual environments.

QUERY

Is there a recommended method for creating a venv and installing paramiko to use with yhe SV modules?

I have an update on this.

If I create a venv and activate it I can then set the ansible_python_interpreter to the python executable in the venv/bin folder.

On a RHEL 8 system which has Tower installed I can then install paramiko and run my SCV playbook from the CLI.

However, if the RHEL 8 system does NOT have Tower installed the install of paramiko fails with dependency issues.

So, after creating a venv and updating pip what else is required to enable paramiko so that I can run the SV modules on RHEL 8?

I managed to solved this.

  1. Create a python virtual environment in the root folder of your Ansible project

  2. Activate the venv

  3. Upgrade python pip

  4. Run: pip install paramiko
    This will probably fail due to missing dependencies, if so then:

  5. sudo dnf install libffi-devel python36-devel make rust gcc cargo openssl-devel -y

  6. pip install paramiko
    Paramiko should be built from source now

  7. Ensure the playbook running the SV modules uses the python venv executable
    a) add --extra_vars "ansible_python_interpretor=/path/to/python/venv/directory/containing/python3"
    OR
    b) override ansible_python_interpretor in the playbook to /path/to/python/venv/directory/containing/python3

One caveat, you need to ensure that the python venv is activated before running the playbook.

Thanks Robin 👍

pip install paramiko should just work providing you actually follow the first 3 steps (at step 3, run pip install --upgrade pip). No need to build from source

we get below:
image

@swaroopska01 are you facing some issue? Paramiko is only required if you are using "ibm_svcinfo_command" or "ibm_svctask_command" modules. Rest of the modules don't require paramiko.