config-download: don't use vars in tripleo_common/templates/deployments.yaml

Bug #1760990 reported by James Slagle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
James Slagle

Bug Description

sdoran has indicated that vars is an internal api not to be consumed in ansible tasks/templates. We should migrate to using hostvars instead in tripleo_common/templates/deployments.yaml.

Changed in tripleo:
status: New → Triaged
importance: Undecided → Medium
milestone: none → rocky-2
tags: added: config-download
summary: - config-download: use hostvars instead of vars in
+ config-download: don't use vars in
tripleo_common/templates/deployments.yaml
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/559433

Changed in tripleo:
assignee: nobody → James Slagle (james-slagle)
status: Triaged → In Progress
Revision history for this message
James Slagle (james-slagle) wrote :

the patch i came up with actually doesn't use hostvars either, which is an improvement in terms of escaping issues and memory usage.

Changed in tripleo:
milestone: rocky-2 → rocky-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (master)

Reviewed: https://review.openstack.org/559433
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=60f25d2bcd08d58b3bbbe63a1c9b9e156c5ab5cc
Submitter: Zuul
Branch: master

commit 60f25d2bcd08d58b3bbbe63a1c9b9e156c5ab5cc
Author: James Slagle <email address hidden>
Date: Fri Apr 6 17:24:08 2018 -0400

    Don't set deployments as hostvars

    This patch updates config-download to not create a vars file under
    group_vars for the server deployments. These variables end up as
    hostvars in Ansible, which has caused many escaping problems since
    hostvars are run through the templating engine.

    In combination with I06c9b3256567cc57d599bd4d9af617c718d2314f, these
    escaping problems should be eliminated.

    Additionally, by not using hostvars (set_fact), we can save memory since
    a hostvar is set on a host and persisted in memory. With many hosts and
    large deployments (such as all hiera data), this would have eventually
    been an issue.

    Instead, an Ansible lookup is used in deployments.yaml to read
    deployment data, which are now written to individual files by
    config-download. This also improves readability instead of having one
    big file of all deployment data.

    Change-Id: Ie09fc64cf85eb532f31684f1c9808b942672ff41
    Closes-Bug: #1760990

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

This issue was fixed in the openstack/tripleo-common 9.0.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-common (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.openstack.org/564056

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-common (stable/queens)

Reviewed: https://review.openstack.org/564056
Committed: https://git.openstack.org/cgit/openstack/tripleo-common/commit/?id=21a8c7f905915d2c92a9a96a0f393f945af128bc
Submitter: Zuul
Branch: stable/queens

commit 21a8c7f905915d2c92a9a96a0f393f945af128bc
Author: James Slagle <email address hidden>
Date: Fri Apr 6 17:24:08 2018 -0400

    Don't set deployments as hostvars

    This patch updates config-download to not create a vars file under
    group_vars for the server deployments. These variables end up as
    hostvars in Ansible, which has caused many escaping problems since
    hostvars are run through the templating engine.

    In combination with I06c9b3256567cc57d599bd4d9af617c718d2314f, these
    escaping problems should be eliminated.

    Additionally, by not using hostvars (set_fact), we can save memory since
    a hostvar is set on a host and persisted in memory. With many hosts and
    large deployments (such as all hiera data), this would have eventually
    been an issue.

    Instead, an Ansible lookup is used in deployments.yaml to read
    deployment data, which are now written to individual files by
    config-download. This also improves readability instead of having one
    big file of all deployment data.

    Change-Id: Ie09fc64cf85eb532f31684f1c9808b942672ff41
    Closes-Bug: #1760990
    Closes-Bug: #1763779
    (cherry picked from commit 60f25d2bcd08d58b3bbbe63a1c9b9e156c5ab5cc)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-common 8.6.2

This issue was fixed in the openstack/tripleo-common 8.6.2 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.