HewlettPackard / oneview-ansible-collection

Ansible Collection and Sample Playbooks for HPE OneView
Apache License 2.0
26 stars 22 forks source link

Issues with installation / conflicts #261

Closed joaofeteira closed 1 year ago

joaofeteira commented 1 year ago

Hi,

Following the steps for the installation: ansible-galaxy collection install hpe.oneview ansible-galaxy collection install hpe.oneview --force

I try to launch a simple command just to test:

    - name: Gather Facts
      oneview_ethernet_network_facts:
        hostname: "HOST"
        username: "USERNAME"
        password: "PASSWORD"
        api_version: 5400
      no_log: true

And I get this output:

exit status 1. Output: ERROR! [DEPRECATED]: community.general.oneview_ethernet_network_facts has been removed. Use
│ community.general.oneview_ethernet_network_info instead. This feature was removed from community.general in version 3.0.0. Please update your playbooks.

If I try to perform the suggested change to oneview_ethernet_network_info I get:

The error was: ModuleNotFoundError: No module named 'hpOneView'
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (hpOneView) on util'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"}

Any tips?

BR

alisha-k-kalladassery commented 1 year ago

I think you are still using deprecated 'hpOneView' library. Please uninstall 'hpOneView' if it exists in your system and install 'hpeOneView'.

joaofeteira commented 1 year ago

Hi @alisha-k-kalladassery thanks for the reply but this was a new VM with no previous install. I just installed as per the instructions:


ansible-galaxy collection install hpe.oneview
ansible-galaxy collection install hpe.oneview --force
Starting galaxy collection install process
Nothing to do. All requested collections are already installed. If you want to reinstall them, consider using `--force`.
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Downloading https://galaxy.ansible.com/download/hpe-oneview-8.4.0.tar.gz to /xxxx/.ansible/tmp/ansible-local-2132974jmdrptdk/tmpavpzk7tr/hpe-oneview-8.4.0-540_jd68
Installing 'hpe.oneview:8.4.0' to '/xxxx/.ansible/collections/ansible_collections/hpe/oneview'
hpe.oneview:8.4.0 was installed successfully

ansible-galaxy collection list | grep hp
hpe.oneview                   8.4.0  
hpe.nimble                    1.1.4  
alisha-k-kalladassery commented 1 year ago

Have you installed hpeOneView dependency package also? if yes, could you please confirm by checking pip list

joaofeteira commented 1 year ago

Sure with the proper command:

pip install -r ~/.ansible/collections/ansible_collections/hpe/oneview/requirements.txt Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: hpICsp in /xxxx/.local/lib/python3.10/site-packages (from -r /xxxx/.ansible/collections/ansible_collections/hpe/oneview/requirements.txt (line 1)) (1.0.2) Collecting hpeOneView Using cached hpeOneView-8.4.0-py3-none-any.whl (190 kB) Requirement already satisfied: future>=0.15.2 in /usr/lib/python3/dist-packages (from hpICsp->-r /xxxx/.ansible/collections/ansible_collections/hpe/oneview/requirements.txt (line 1)) (0.18.2) Requirement already satisfied: docutils<0.18 in /xxxx/.local/lib/python3.10/site-packages (from hpeOneView->-r /xxxx/.ansible/collections/ansible_collections/hpe/oneview/requirements.txt (line 2)) (0.17.1) Installing collected packages: hpeOneView Successfully installed hpeOneView-8.4.0

pip list | grep hp hpeOneView 8.4.0 hpICsp 1.0.2 launchpadlib 1.10.16

alisha-k-kalladassery commented 1 year ago

If you are using the latest OneView Ansible Collection, you should not be having oneview_ethernet_network_info. We dont have a module named oneview_ethernet_network_info in OneView Ansible Collection. If you have cloned any github repository and is using the same, please make sure you are using repo

joaofeteira commented 1 year ago

Yes i know . I installed it through the commands on your README as mentioned

Ok I changed to hpe.oneview.oneview_ethernet_network_facts: instead of just oneview_ethernet_network_facts: and it seems to find the collection now But still putting out errors as if i did not install the dependencies:

PLAY [General Packages Installation] *******************************************************************************************************************************************

TASK [Gather Facts] ************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "HPE OneView Python SDK is required for this module."}

PLAY RECAP *********************************************************************************************************************************************************************
localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0  

Which I did with the proper command:

pip install -r ~/.ansible/collections/ansible_collections/hpe/oneview/requirements.txt
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: hpICsp in /xxxx/.local/lib/python3.10/site-packages (from -r /xxxx/.ansible/collections/ansible_collections/hpe/oneview/requirements.txt (line 1)) (1.0.2)
Collecting hpeOneView
Using cached hpeOneView-8.4.0-py3-none-any.whl (190 kB)
Requirement already satisfied: future>=0.15.2 in /usr/lib/python3/dist-packages (from hpICsp->-r /xxxx/.ansible/collections/ansible_collections/hpe/oneview/requirements.txt (line 1)) (0.18.2)
Requirement already satisfied: docutils<0.18 in /xxxx/.local/lib/python3.10/site-packages (from hpeOneView->-r /xxxx/.ansible/collections/ansible_collections/hpe/oneview/requirements.txt (line 2)) (0.17.1)
Installing collected packages: hpeOneView
Successfully installed hpeOneView-8.4.0

pip list | grep hp
hpeOneView 8.4.0
hpICsp 1.0.2
launchpadlib 1.10.16
joaofeteira commented 1 year ago

We can close this. I was using a become:yes in the play which was the reason of the failure. thanks