config_template does not support {% raw %}

Bug #1649381 reported by Logan V
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Low
Unassigned

Bug Description

config_template is trying to resolve jinja that is contained within {% raw %}{% endraw %}
blocks.

Gate log showing this:
http://logs.openstack.org/07/409407/6/check/gate-openstack-ansible-openstack-ansible-aio-ubuntu-xenial/cbc046f/console.html.gz#_2016-12-10_05_52_39_773969

See line 127 here: https://review.openstack.org/#/c/409407/6/tests/roles/bootstrap-host/templates/user_variables.aio_ceph.yml.j2 for the syntax that is breaking this.

Changed in openstack-ansible:
importance: Undecided → Low
Praveen N (praveenn)
Changed in openstack-ansible:
assignee: nobody → Praveen N (praveenn)
Changed in openstack-ansible:
status: New → Incomplete
status: Incomplete → Confirmed
assignee: Praveen N (praveenn) → nobody
Revision history for this message
Jean-Philippe Evrard (jean-philippe-evrard) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to ansible-config_template (master)
Changed in openstack-ansible:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to ansible-config_template (master)

Reviewed: https://review.opendev.org/c/openstack/ansible-config_template/+/881879
Committed: https://opendev.org/openstack/ansible-config_template/commit/fdb572d0ba09397c13d864adf549699160e804c2
Submitter: "Zuul (22348)"
Branch: master

commit fdb572d0ba09397c13d864adf549699160e804c2
Author: Dmitriy Rabotyagov <email address hidden>
Date: Fri Apr 28 20:25:57 2023 +0200

    Add support for start/end_string arguments

    In case template contains some Jinja content that we don't want to
    resolve, there're not much options due to the bug, that ignores
    {% raw %} tags. The other way to work it around is to override tags that
    Jinja will use to detect the content it needs to render. This way
    content that should be renderred can be placed in the same template
    with the one that needs to stay intact.

    Change-Id: I4d28f5ab03858f5555f5e9e555da1dddc0f2b016
    Related-Bug: #1649381

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-config_template (master)

Reviewed: https://review.opendev.org/c/openstack/ansible-config_template/+/881887
Committed: https://opendev.org/openstack/ansible-config_template/commit/e528ed0e9e9f3d3fcb2f33ddc5d175faf72094ac
Submitter: "Zuul (22348)"
Branch: master

commit e528ed0e9e9f3d3fcb2f33ddc5d175faf72094ac
Author: Dmitriy Rabotyagov <email address hidden>
Date: Sat Apr 29 05:14:16 2023 +0200

    Fix usage of {% raw %} tags and Jinja2 headers

    At the moment we do resolve template 2 times for some historical reasons

    This leads to {% raw %} tag as well as any other content be not respected
    on the second renderring, since after the first one these tags
    are gone, so no escaping or whatsoever work.

    At the same time there're no obvious reasons to render second time,
    since all override content is being renderred already. So there should
    not be anything left that indeed needs this second run.

    Change-Id: I414b1b3b4e426316707dda23b9aeff6b6f4f7c2f
    Closes-Bug: #1649381

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/ansible-config_template 2.1.0

This issue was fixed in the openstack/ansible-config_template 2.1.0 release.

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.