Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Cannot tweak IPv6 attributes on iDRAC 8 #488

Closed
mreho opened this issue Mar 21, 2023 · 3 comments
Closed

[BUG]: Cannot tweak IPv6 attributes on iDRAC 8 #488

mreho opened this issue Mar 21, 2023 · 3 comments
Labels
needs-triage Issue requires triage. type/bug Something isn't working
Milestone

Comments

@mreho
Copy link

mreho commented Mar 21, 2023

Bug Description

Cannot tweak IPv6 attributes on iDRAC 8 using the idrac_attributes module, which works just fine on iDRAC 9.

The ExportSystemConfiguration endpoint of this iDRAC 8 returns the following :

    { "Name": "IPv6.1#Enable",
      "Value": "Disabled",
      "Set On Import": "True",
      "Comment": "Read and Write" },
    { "Name": "IPv6.1#AutoConfig",
      "Value": "Disabled",
      "Set On Import": "True",
      "Comment": "Read and Write" },

So I use IPv6.1.Enable and IPv6.1.AutoConfig parameters but the playbook fails.

Component or Module Name

idrac_attributes

Ansible Version

2.14.3

Python Version

3.10.6

iDRAC/OME/OME-M version

iDRAC 8 v2.83.83.83

Operating System

Ubuntu 22.04.2 LTS

Playbook Used

  - name: Network
    idrac_attributes:
      idrac_ip: "{{ ipmi_ipv4 }}"
      idrac_user: "{{ username }}"
      idrac_password: "{{ password }}"
      ca_path: files/myca.pem
      validate_certs: false
      idrac_attributes:
        IPv4Static.1.DNSFromDHCP: Enabled
        IPv6.1.Enable: Enabled
        IPv6.1.AutoConfig: Disabled
        NIC.1.DNSRacName: "{{ ipmi_hostname }}"
        NICStatic.1.DNSDomainFromDHCP: Enabled
        NIC.1.DNSRegister: Enabled

Logs

fatal: [myhostname.mydomain.tld]: FAILED! => {
    "changed": false,
    "invalid_attributes": {
        "IPv6.1.AutoConfig": "Attribute does not exist.",
        "IPv6.1.Enable": "Attribute does not exist."
    },
    "invocation": {
        "module_args": {
            "ca_path": "files/myca.pem",
            "idrac_attributes": {
                "IPv4Static.1.DNSFromDHCP": "Enabled",
                "IPv6.1.AutoConfig": "Disabled",
                "IPv6.1.Enable": "Enabled",
                "NIC.1.DNSRacName": "myhostname",
                "NIC.1.DNSRegister": "Enabled",
                "NICStatic.1.DNSDomainFromDHCP": "Enabled"
            },
            "idrac_ip": "10.0.0.1",
            "idrac_password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "idrac_port": 443,
            "idrac_user": "myuser",
            "lifecycle_controller_attributes": null,
            "resource_id": null,
            "system_attributes": null,
            "timeout": 30,
            "validate_certs": false
        }
    },
    "msg": "Attributes have invalid values."
}

Steps to Reproduce

Run this task

Expected Behavior

Expected to be working, status [ok] or [changed]

Actual Behavior

[failed]

Screenshots

No response

Additional Information

No response

@mreho mreho added needs-triage Issue requires triage. type/bug Something isn't working labels Mar 21, 2023
@anupamaloke
Copy link
Collaborator

@mreho, thank you for submitting this issue. We will be triaging this and accordingly add it to our backlog to be fixed in future releases.

@sachin-apa
Copy link
Collaborator

sachin-apa commented Jun 27, 2023

I found out that the problem was in the below line of code.

The regular expression looks wrong and is matching the “.” after the digit and replacing it with ‘#’ in the code for idrac8 (SCP).

For IPv6.1.Enable since the key has digit 6, it is matching both the ‘.’ After 6 and 1 and for ex SNMP.1.AgentCommunity where it is working it is matching only last “.” After digit 1.

This bug needs to be fixed and the ideal logic should be to match the last occurrence of . and replace with #: \.(?!\d)
key = re.sub(r"\.(?!\d)", "#", k)

@sachin-apa sachin-apa added this to the v8.1.0 milestone Jul 5, 2023
@sachin-apa
Copy link
Collaborator

Closing the issue as this is fixed with PR # 512 Release 8.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Issue requires triage. type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants