60f25d2bcd
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
30 lines
933 B
Django/Jinja
30 lines
933 B
Django/Jinja
deploy_server_id: {{ server_id }}
|
|
|
|
{{ deployment.get('deployment_name') }}:
|
|
{% if deployment.get('scalar') %}
|
|
config: |
|
|
{% else %}
|
|
config:
|
|
{% endif %}
|
|
{{ deployment.get('config') | string | indent(4, true) }}
|
|
creation_time: "{{ deployment.get('creation_time') }}"
|
|
deployment_name: {{ deployment.get('deployment_name') }}
|
|
group: {{ deployment.get('group') }}
|
|
id: {{ deployment.get('id') }}
|
|
inputs:
|
|
{% for input in deployment.get('inputs') %}
|
|
- name: {{ input.get('name') }}
|
|
description: {{ input.get('description') }}
|
|
type: {{ input.get('type') }}
|
|
value: |-
|
|
{{ input.get('value') | string | indent(8, true) }}
|
|
{% endfor %}
|
|
name: {{ deployment.get('name') }}
|
|
options: {{ deployment.get('options') }}
|
|
outputs:
|
|
{% for output in deployment.get('outputs') %}
|
|
- name: {{ output.get('name') }}
|
|
description: {{ output.get('description') }}
|
|
type: {{ output.get('type') }}
|
|
{% endfor %}
|