openstack-ansible/releasenotes/notes/config_overrides_dict_key_vars-962b4bebca02c477.yaml
Dmitriy Rabotyagov 4203aa26c6 Modify RGW client format
With changes to config_template module that restored usage of {% raw %} tags [1]
renderring of mapping keys, if they're defined as variables, was broken.

Ansible, by design [2], does not render mapping keys. Moreover, it was not
working as intended anyway, since renderring happened in post-copy stage
so same records were not merged together, which resulted in #1812245

As such behaviour is expected by Ansible design, instead of adding some
workaround in config_template module, I suggest working around issue
by defining troublesome mapping with Jinja, that will allow it to render properly.

[1] https://review.opendev.org/c/openstack/ansible-config_template/+/881887
[2] https://github.com/ansible/ansible/issues/17324#issuecomment-685102595

Closes-Bug: #2048036
Related-Bug: #1812245
Change-Id: I8a32736239c6326d817c620451799c13d5d8938c
2024-01-04 14:41:59 +00:00

35 lines
882 B
YAML

---
issues:
- |
With recent changes to config_template module, it is not possible
anymore to have variables as dictionary keys in overrides. Example below
will not be renderred properly:
.. code-block:: yaml
config_overrides:
"{{ inventory_hostname }}":
cruel: world
This limitation boils down to Ansible design and will be true for any other
module as well.
In order to overcome it, you can transform the dictionary to a Jinja2 format:
.. code-block:: yaml
config_overrides: |-
{{
{
inventory_hostname: {
'cruel': 'world'
}
}
}}
fixes:
- |
Fixes format of ``ceph_conf_overrides_rgw`` variable by converting override
dictionary to Jinja2 format to workaround Ansible limitation on usage of
variables as keys in dictionary.