34 lines
1013 B
YAML
34 lines
1013 B
YAML
- name: "Render deployment file for {{ item }}"
|
|
template:
|
|
src: ../templates/heat-config.j2
|
|
dest: "/var/lib/heat-config/tripleo-config-download/{{ item }}"
|
|
become: true
|
|
vars:
|
|
deployment: "{{ vars[item] | to_json }}"
|
|
|
|
- name: "Force remove deployed file for {{ item }}"
|
|
file:
|
|
path: /var/lib/heat-config/deployed/{{ vars[item].id }}.json
|
|
state: absent
|
|
become: true
|
|
when: force | bool
|
|
|
|
- name: "Run deployment {{ item }}"
|
|
shell: |
|
|
/usr/libexec/os-refresh-config/configure.d/55-heat-config
|
|
exit $(jq .deploy_status_code /var/lib/heat-config/deployed/{{ vars[item].id }}.notify.json)
|
|
become: true
|
|
environment:
|
|
HEAT_SHELL_CONFIG: /var/lib/heat-config/tripleo-config-download/{{ item }}
|
|
register: deployment_result
|
|
ignore_errors: yes
|
|
|
|
- name: "Output for {{ item }}"
|
|
debug:
|
|
msg:
|
|
- stderr: "{{ deployment_result.stderr.split('\n') }}"
|
|
- status_code: "{{ deployment_result.rc }}"
|
|
tags:
|
|
- output
|
|
failed_when: deployment_result.rc not in (0, 2)
|