identity_domain module does rename domain if ID is suppliedlied for "name" attribute

Bug #2065680 reported by Dmitriy Rabotyagov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ansible-collections-openstack
New
Undecided
Unassigned

Bug Description

Issue description

In some cases, identity_domain may rename the domain name to it's UUID if UUID is supplied to the `name` attribute.

Current behaviour

Good example of that is `default` domain. So this sample playbook can reproduce the behaviour of renaming domain Default to it's UUID:

- hosts: localhost
  tasks:
    - name: Ensure domain exists
      openstack.cloud.identity_domain:
        cloud: default
        state: present
        name: Default
        endpoint_type: admin

    - name: Get default domain
      openstack.cloud.identity_domain_info:
        cloud: default
        name: default
      register: currentstate

    - debug:
        var: currentstate

    - name: Unintentionally change domain name
      openstack.cloud.identity_domain:
        cloud: default
        state: present
        name: default
        endpoint_type: admin

    - name: Get default domain
      openstack.cloud.identity_domain_info:
        cloud: default
        name: default
      register: laststate

    - debug:
        var: laststate

The output will be follpwing:

TASK [Ensure domain exists] ****************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [Get default domain] ******************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [debug] *******************************************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "currentstate": {
        "changed": false,
        "domains": [
            {
                "description": "",
                "id": "default",
                "is_enabled": true,
                "links": {
                    "self": "https://172.16.0.10:5000/v3/domains/default"
                },
                "name": "Default"
            }
        ],
        "failed": false
    }
}

TASK [Unintentionally change domain name] **************************************************************************************************************************************************************************************************
changed: [localhost]

TASK [Get default domain] ******************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [debug] *******************************************************************************************************************************************************************************************************************************
ok: [localhost] => {
    "laststate": {
        "changed": false,
        "domains": [
            {
                "description": "",
                "id": "default",
                "is_enabled": true,
                "links": {
                    "self": "https://172.16.0.10:5000/v3/domains/default"
                },
                "name": "default"
            }
        ],
        "failed": false
    }
}

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

Expected behavior

It is expected, that name of the domain is pretty much immutable in current setup, since there is no means to supply module explicitly with domain UUID AND name, signalizing that name should be changed.
So atm there should not be really a way to update the domain name without introducing another attribute for UUID explicitly.

Revision history for this message
Dmitriy Rabotyagov (noonedeadpunk) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.