HewlettPackard / ilo-ansible-collection

Ansible Collection and Sample Playbooks for HPE iLO
Apache License 2.0
43 stars 23 forks source link

`roles/get_logical_drives_details` does not work #10

Closed youngsensei144 closed 1 year ago

youngsensei144 commented 2 years ago

Dear HPE Developers,

I've installed this collection in my environment, but I am not sure if these playbooks and python modules have actually been tested to work.

For instance, when in an attempt to run the role get_local_drive_details, I'd get an error like this:

FAILED! => {"changed": false, "msg": "Failed to import the required Python library (redfish) on <MACHINE>.local's 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"}

But I've got redfish already installed in my current python env, e.g. pip3 list | grep -i redfish:

redfish                3.1.7

Upon closer inspection, when one looks at the underlying python script ./ilo-ansible-collection/plugins/modules/get_logical_drives_details.py, we see an import like the following:

from redfish import redfish_client

Do we mean import RedfishClient? e.g.

>>> from redfish import RedfishClient
>>> 
>>> RedfishClient
<class 'redfish.rest.v1.RedfishClient'>

There are many engineers who administer HPE servers who would really benefit from HPE being able to procure a stable collection for Ansible where they can easily interact with iLO for things like creating logical drives, mounting virtual isos, adding iLO users, changing iLO I.P. addresses, etc. via playbooks. Thank you for your efforts.

donzef commented 2 years ago

@youngsensei144 , I suspect you installed the HPE python-ilorest-library before installing the DMTF redfish library. Unfortunately, those 2 libraries can't coexist. Not sure where this is documented, but you should try the following:

pip uninstall redfish pip uninstall python-ilorest-library pip install redfish

TSKushal commented 2 years ago

Hi @youngsensei144, What @donzef has said seems to be right. Just tested the modules and they are working. Please try installing redfish with the below command pip3 install redfish==3.0.2

It should work after that.

rajeevkallur commented 1 year ago

This will be closed. Please reopen in case issue reappears