Horizon: inability to override policies with ansible 6+

Bug #2045660 reported by Andriy Kurilin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
Fix Released
Critical
Andriy Kurilin
Antelope
Fix Released
Undecided
Unassigned
Bobcat
Fix Released
Critical
Andriy Kurilin

Bug Description

Kolla-ansible fails to override horizon policies files due to possible bug regression in ansible lib (https://github.com/ansible/ansible/issues/39389) that affects list concatenation using "set_fact" and "with_items".

Validation by CI: https://review.opendev.org/c/openstack/kolla-ansible/+/901761

Ansible release: 6+
Kolla-Ansible: 2023.1+ (required ansible 6)

Traceback:

```
Traceback (most recent call last):
  File "/home/zuul/kolla-ansible-venv/lib/python3.10/site-packages/ansible/plugins/action/template.py", line 94, in run
    source = self._find_needle('templates', source)
  File "/home/zuul/kolla-ansible-venv/lib/python3.10/site-packages/ansible/plugins/action/__init__.py", line 1455, in _find_needle
    return self._loader.path_dwim_relative_stack(path_stack, dirname, needle)
  File "/home/zuul/kolla-ansible-venv/lib/python3.10/site-packages/ansible/parsing/dataloader.py", line 341, in path_dwim_relative_stack
    raise AnsibleFileNotFound(file_name=source, paths=[to_native(p) for p in search])
ansible.errors.AnsibleFileNotFound: Could not find or access '[] + [ '/etc/kolla/config/horizon/neutron_policy.yaml' ] + [ '/etc/kolla/config/horizon/nova_policy.yaml' ]'
Searched in:
 /home/zuul/kolla-ansible-venv/share/kolla-ansible/ansible/roles/horizon/templates/[] + [ '/etc/kolla/config/horizon/neutron_policy.yaml' ] + [ '/etc/kolla/config/horizon/nova_policy.yaml' ]
 /home/zuul/kolla-ansible-venv/share/kolla-ansible/ansible/roles/horizon/[] + [ '/etc/kolla/config/horizon/neutron_policy.yaml' ] + [ '/etc/kolla/config/horizon/nova_policy.yaml' ]
 /home/zuul/kolla-ansible-venv/share/kolla-ansible/ansible/roles/horizon/tasks/templates/[] + [ '/etc/kolla/config/horizon/neutron_policy.yaml' ] + [ '/etc/kolla/config/horizon/nova_policy.yaml' ]
 /home/zuul/kolla-ansible-venv/share/kolla-ansible/ansible/roles/horizon/tasks/[] + [ '/etc/kolla/config/horizon/neutron_policy.yaml' ] + [ '/etc/kolla/config/horizon/nova_policy.yaml' ]
 /home/zuul/kolla-ansible-venv/share/kolla-ansible/ansible/templates/[] + [ '/etc/kolla/config/horizon/neutron_policy.yaml' ] + [ '/etc/kolla/config/horizon/nova_policy.yaml' ]
 /home/zuul/kolla-ansible-venv/share/kolla-ansible/ansible/[] + [ '/etc/kolla/config/horizon/neutron_policy.yaml' ] + [ '/etc/kolla/config/horizon/nova_policy.yaml' ] on the Ansible Controller.
If you are using a module and expect the file to exist on the remote, see the remote_src option
```

Revision history for this message
Andriy Kurilin (andreykurilin) wrote :
description: updated
Changed in kolla-ansible:
status: New → Confirmed
importance: Undecided → Critical
Changed in kolla-ansible:
assignee: nobody → Andriy Kurilin (andreykurilin)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (master)
Changed in kolla-ansible:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (master)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/902659
Committed: https://opendev.org/openstack/kolla-ansible/commit/97cd173177c88f08e62fa4b4f57a3c34a46f1c2a
Submitter: "Zuul (22348)"
Branch: master

commit 97cd173177c88f08e62fa4b4f57a3c34a46f1c2a
Author: Andrey Kurilin <email address hidden>
Date: Thu Nov 23 15:24:08 2023 +0100

    Fix broken list concatenation in horizon role

    Starting with ansible-core 2.13, list concatenation format is changed
    and does not support concatenation operations outside of the jinja template.

    The format change:

      "[1] + {{ [2] }}" -> "{{ [1] + [2] }}"

    This affects the horizon role that iterates over existing policy files to
    override and concatenate them into a single variable.

    Co-Authored-By: Dr. Jens Harbott <email address hidden>

    Closes-Bug: #2045660
    Change-Id: I91a2101ff26cb8568f4615b4cdca52dcf09e6978

Changed in kolla-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/902821

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/902822

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/902821
Committed: https://opendev.org/openstack/kolla-ansible/commit/6ba26e7a1349b008221c5b494fab8635a9557d2b
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 6ba26e7a1349b008221c5b494fab8635a9557d2b
Author: Andrey Kurilin <email address hidden>
Date: Thu Nov 23 15:24:08 2023 +0100

    Fix broken list concatenation in horizon role

    Starting with ansible-core 2.13, list concatenation format is changed
    and does not support concatenation operations outside of the jinja template.

    The format change:

      "[1] + {{ [2] }}" -> "{{ [1] + [2] }}"

    This affects the horizon role that iterates over existing policy files to
    override and concatenate them into a single variable.

    Co-Authored-By: Dr. Jens Harbott <email address hidden>

    Closes-Bug: #2045660
    Change-Id: I91a2101ff26cb8568f4615b4cdca52dcf09e6978
    (cherry picked from commit 97cd173177c88f08e62fa4b4f57a3c34a46f1c2a)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 17.0.0.0rc2

This issue was fixed in the openstack/kolla-ansible 17.0.0.0rc2 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/902822
Committed: https://opendev.org/openstack/kolla-ansible/commit/aa860978ac121f01b9f84b24eb997b1438022ad8
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit aa860978ac121f01b9f84b24eb997b1438022ad8
Author: Andrey Kurilin <email address hidden>
Date: Thu Nov 23 15:24:08 2023 +0100

    Fix broken list concatenation in horizon role

    Starting with ansible-core 2.13, list concatenation format is changed
    and does not support concatenation operations outside of the jinja template.

    The format change:

      "[1] + {{ [2] }}" -> "{{ [1] + [2] }}"

    This affects the horizon role that iterates over existing policy files to
    override and concatenate them into a single variable.

    Co-Authored-By: Dr. Jens Harbott <email address hidden>

    Closes-Bug: #2045660
    Change-Id: I91a2101ff26cb8568f4615b4cdca52dcf09e6978
    (cherry picked from commit 97cd173177c88f08e62fa4b4f57a3c34a46f1c2a)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 16.3.0

This issue was fixed in the openstack/kolla-ansible 16.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla-ansible (stable/zed)

Fix proposed to branch: stable/zed
Review: https://review.opendev.org/c/openstack/kolla-ansible/+/915018

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla-ansible (stable/zed)

Reviewed: https://review.opendev.org/c/openstack/kolla-ansible/+/915018
Committed: https://opendev.org/openstack/kolla-ansible/commit/4d649e3daf6b1055d8e2e5cd30fec6866cf9ae8b
Submitter: "Zuul (22348)"
Branch: stable/zed

commit 4d649e3daf6b1055d8e2e5cd30fec6866cf9ae8b
Author: Andrey Kurilin <email address hidden>
Date: Thu Nov 23 15:24:08 2023 +0100

    Fix broken list concatenation in horizon role

    Starting with ansible-core 2.13, list concatenation format is changed
    and does not support concatenation operations outside of the jinja template.

    The format change:

      "[1] + {{ [2] }}" -> "{{ [1] + [2] }}"

    This affects the horizon role that iterates over existing policy files to
    override and concatenate them into a single variable.

    Co-Authored-By: Dr. Jens Harbott <email address hidden>

    Closes-Bug: #2045660
    Change-Id: I91a2101ff26cb8568f4615b4cdca52dcf09e6978
    (cherry picked from commit 97cd173177c88f08e62fa4b4f57a3c34a46f1c2a)

tags: added: in-stable-zed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible zed-eom

This issue was fixed in the openstack/kolla-ansible zed-eom release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/kolla-ansible 18.0.0.0rc1

This issue was fixed in the openstack/kolla-ansible 18.0.0.0rc1 release candidate.

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.