Browse Source

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
(cherry picked from commit 21754e9987)
(cherry picked from commit 44da685cb0)
(cherry picked from commit 74991a643a)
tags/8.7.1
Emilien Macchi 2 weeks ago
parent
commit
300074ee2b

+ 14
- 0
tripleo_common/templates/group_var_role.j2 View File

@@ -3,8 +3,22 @@
3 3
   - {{ deployment }}
4 4
 {% endfor %}
5 5
 
6
+# Temporary duplication
7
+# https://bugs.launchpad.net/tripleo/+bug/1842141
8
+pre_deployments_{{ role }}: {% if not pre_deployments %} [] {% endif %}
9
+
10
+{% for deployment in pre_deployments %}
11
+  - {{ deployment }}
12
+{% endfor %}
13
+
6 14
 {{ role }}_post_deployments: {% if not post_deployments %} [] {% endif %}
7 15
 
8 16
 {% for deployment in post_deployments %}
9 17
   - {{ deployment }}
10 18
 {% endfor %}
19
+
20
+post_deployments_{{ role }}: {% if not post_deployments %} [] {% endif %}
21
+
22
+{% for deployment in post_deployments %}
23
+  - {{ deployment }}
24
+{% endfor %}

+ 8
- 0
tripleo_common/tests/utils/data/Compute View File

@@ -5,3 +5,11 @@ Compute_pre_deployments:
5 5
   - AnsibleDeployment
6 6
 
7 7
 Compute_post_deployments:  []
8
+
9
+pre_deployments_Compute:
10
+  - ComputeHostEntryDeployment
11
+  - NetworkDeployment
12
+  - MyExtraConfigPost
13
+  - AnsibleDeployment
14
+
15
+post_deployments_Compute:  []

+ 8
- 0
tripleo_common/tests/utils/data/Controller View File

@@ -5,3 +5,11 @@ Controller_pre_deployments:
5 5
   - MyExtraConfigPost
6 6
 
7 7
 Controller_post_deployments:  []
8
+
9
+pre_deployments_Controller:
10
+  - ControllerHostEntryDeployment
11
+  - NetworkDeployment
12
+  - MyPostConfig
13
+  - MyExtraConfigPost
14
+
15
+post_deployments_Controller:  []

Loading…
Cancel
Save