HewlettPackard / oneview-ansible

This project is no longer being developed and has limited support. Please use the newer Ansible Collection project: https://github.com/HewlettPackard/oneview-ansible-collection
Apache License 2.0
104 stars 65 forks source link

Add option to specify appliance login directory or search more than just the default login directory #677

Closed liamwh closed 3 years ago

liamwh commented 3 years ago

Scenario/Intent

Specify local username and password to authenticate to OneView appliance using hpe.oneview.oneview_server_hardware_facts but it has the default login directory set to AD.

Environment Details

Steps to Reproduce

image image

Expected Result

Facts gathered successfully. Changing default login directory to local makes the module work. Specifying Local\ or Local\ in front of the username does not work.

Actual Result

image

SHANDCRUZ commented 3 years ago

Hi @liamwh, have you tried to login using the local credentials in the oneview appliance from browser..? Can you confirm if you are able to login using both local and AD credentials in browser.

liamwh commented 3 years ago

Hi @liamwh, have you tried to login using the local credentials in the oneview appliance from browser..? Can you confirm if you are able to login using both local and AD credentials in browser.

Yes, I am able to login via the local directory. The user has infrastructure administrator permission. Changing the default login directory on OneView to Local allows this module to work.

VenkateshRavula commented 3 years ago

Hi @liamwh, We have provided an option to specify the login domain in the config file but unfortunately we forgot to mention that parameter in the oneview_config.json file. We will fix it soon. Meanwhile can you please try adding authLoginDomain in the credentials section of config file as mentioned below.

{
  "ip": "<oneview_ip>",
  "credentials": {
    "userName": "<username>",
    "password": "<password>",
    "authLoginDomain": "<login_directory>"
  },
  "image_streamer_ip": "<i3s_ip>",
  "api_version": 2600
}

or please add the auth_login_domain in your playbook args as shown below

- name: Gather facts about an existing Server Hardware
  hpe.oneview.oneview_server_hardware_facts:
    hostname: "{{ management_card.appliance }}"
    username: mylocalusername
    password: mylocaluserpassword
    auth_login_domain: "LOCAL"
    name: "{{ management_card.hostname }}"
  delegate_to: localhost
  register: hardware_facts

Please let us know if it helps.

liamwh commented 3 years ago

Thanks @VenkateshRavula!

Adding auth_login_domain: "LOCAL" to the yaml causes the module to work. I advise updating the collection documentation to make a note of this.

Thanks again! 👍

VenkateshRavula commented 3 years ago

We will update our README file with necessary information about this. Can you please close this issue.