dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
340 stars 164 forks source link

[BUG]: Can't use LDAP attribute in idrac_attributes #482

Closed mreho closed 1 year ago

mreho commented 1 year ago

Bug Description

LDAP attributes don't work while LDAPRoleGroup works just fine.

Component or Module Name

idrac_attributes

Ansible Version

2.14.3

Python Version

3.10.6

iDRAC/OME/OME-M version

iDRAC 6.10.00.00

Operating System

Ubuntu 22.04.2 LTS

Playbook Used

---
- name: My playbook
  hosts: all
  connection: local
  gather_facts: false
  ignore_errors: true
  tasks:
  - name: Configure iDRAC 9 for production
    block:
      - name: LDAP
        dellemc.openmanage.idrac_attributes:
          idrac_ip: "{{ inventory_hostname }}"
          idrac_user: "{{ username }}"
          idrac_password: "{{ password }}"
          validate_certs: false
          idrac_attributes:
            LDAP.Enable: Enabled
            LDAP.Server: ldap.hostname.tld
            LDAP.BaseDN: "ou=xx,ou=sysadmins,dc=hostname,dc=tld"

Logs

fatal: [my.hostname.tld]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python3"}, "changed": false, "invalid_attributes": {"LDAP.BaseDN": "Attribute does not exist.", "LDAP.Enable": "Attribute does not exist.", "LDAP.Server": "Attribute does not exist."}, "msg": "Attributes have invalid values."}

Steps to Reproduce

Run the playbook with ansible-playbook -i inventory.ini main.yml

Expected Behavior

Expected to be working

Actual Behavior

Fails

Screenshots

No response

Additional Information

No response

mreho commented 1 year ago

Apparently, we have to use LDAP.1.Attribute instead of LDAP.Attribute. Is this normal ?

sachin-apa commented 1 year ago

@mreho That is correct, the key should match the way the iDRAC has in the response from the below URI. redfish/v1/Managers/iDRAC.Embedded.1/Oem/Dell/DellAttributes/iDRAC.Embedded.1

This is also documented in the module docs here

Closing this , please reopen is any.

mreho commented 1 year ago

Thank you for your reply !