config-download: rename pre/post deployment hostvars

We can't have numbers starting an Ansible var, so we need to rename the
pre/post deployments host vars, or we hit this error:
  template error while templating string: expected token 'end of print statement'

https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#creating-valid-variable-names

In this patch we have to duplicate host vars but it'll be cleaned up
once we change to the new file in THT.

Change-Id: Idbdd6a21eb2cd488daa1e3ddc844b4fc5267047c
Related-Bug: #1842141
This commit is contained in:
Emilien Macchi 2019-08-30 17:00:07 -04:00
parent f4c3c1bbbb
commit 21754e9987
5 changed files with 44 additions and 0 deletions

View File

@ -4,12 +4,26 @@
- {{ deployment }}
{% endfor %}
# Temporary duplication
# https://bugs.launchpad.net/tripleo/+bug/1842141
pre_deployments_{{ role }}: {% if not pre_deployments %} [] {% endif %}
{% for deployment in pre_deployments %}
- {{ deployment }}
{% endfor %}
{{ role }}_post_deployments: {% if not post_deployments %} [] {% endif %}
{% for deployment in post_deployments %}
- {{ deployment }}
{% endfor %}
post_deployments_{{ role }}: {% if not post_deployments %} [] {% endif %}
{% for deployment in post_deployments %}
- {{ deployment }}
{% endfor %}
{% if ansible_host_vars %}
# ansible_host_vars managed by TripleO Heat Templates in puppet/role.role.j2.yaml:
{{ ansible_host_vars }}

View File

@ -4,7 +4,15 @@ Controller_pre_deployments:
- MyPostConfig
- MyExtraConfigPost
pre_deployments_Controller:
- ControllerHostEntryDeployment
- NetworkDeployment
- MyPostConfig
- MyExtraConfigPost
Controller_post_deployments: []
post_deployments_Controller: []
uuid: 0
my_var: 'foo'

View File

@ -3,6 +3,13 @@ Compute_pre_deployments:
- NetworkDeployment
- MyExtraConfigPost
pre_deployments_Compute:
- ComputeHostEntryDeployment
- NetworkDeployment
- MyExtraConfigPost
Compute_post_deployments: []
post_deployments_Compute: []
uuid: 1

View File

@ -3,6 +3,13 @@ Compute_pre_deployments:
- NetworkDeployment
- MyExtraConfigPost
pre_deployments_Compute:
- ComputeHostEntryDeployment
- NetworkDeployment
- MyExtraConfigPost
Compute_post_deployments: []
post_deployments_Compute: []
uuid: 2

View File

@ -4,6 +4,14 @@ Compute_pre_deployments:
- MyExtraConfigPost
- AnsibleDeployment
pre_deployments_Compute:
- ComputeHostEntryDeployment
- NetworkDeployment
- MyExtraConfigPost
- AnsibleDeployment
Compute_post_deployments: []
post_deployments_Compute: []
uuid: 3