2020-11-18 19:01:40 +01:00
|
|
|
---
|
2020-11-19 11:56:06 +01:00
|
|
|
- name: Create temporary build directory
|
|
|
|
tempfile:
|
|
|
|
state: directory
|
|
|
|
suffix: build
|
2020-11-19 12:14:55 +01:00
|
|
|
register: target
|
2020-11-19 11:56:06 +01:00
|
|
|
|
2020-11-18 19:01:40 +01:00
|
|
|
- name: Generate workflows
|
|
|
|
template:
|
|
|
|
src: "templates/{{ item }}.json.j2"
|
2020-11-19 12:14:55 +01:00
|
|
|
dest: "{{ target.path }}/{{ item }}.json"
|
2020-11-18 19:01:40 +01:00
|
|
|
loop: "{{ workflows }}"
|
|
|
|
|
2020-12-04 10:03:19 +01:00
|
|
|
- name: Undeploy previous versions of workflows
|
|
|
|
uri:
|
|
|
|
url: "{{ conductor_workflowdef_endpoint }}/{{ item }}/1"
|
|
|
|
method: DELETE
|
2021-05-19 09:48:48 +02:00
|
|
|
force_basic_auth: yes
|
2021-05-18 20:12:27 +02:00
|
|
|
url_username: "{{ user }}"
|
|
|
|
url_password: "{{ password }}"
|
2020-12-04 10:03:19 +01:00
|
|
|
follow_redirects: yes
|
|
|
|
status_code: [200, 204, 404, 500]
|
|
|
|
loop:
|
|
|
|
"{{ workflows }}"
|
|
|
|
|
2020-11-18 19:01:40 +01:00
|
|
|
- name: Upload workflows
|
|
|
|
uri:
|
|
|
|
url: "{{ conductor_workflowdef_endpoint }}"
|
|
|
|
method: POST
|
2020-11-19 12:14:55 +01:00
|
|
|
src: "{{ target.path }}/{{ item }}.json"
|
2020-11-18 19:01:40 +01:00
|
|
|
body_format: json
|
2021-05-19 09:48:48 +02:00
|
|
|
force_basic_auth: yes
|
2021-05-18 20:12:27 +02:00
|
|
|
url_username: "{{ user }}"
|
|
|
|
url_password: "{{ password }}"
|
2020-11-18 19:01:40 +01:00
|
|
|
follow_redirects: yes
|
2020-12-04 10:03:19 +01:00
|
|
|
status_code: [200, 204]
|
2020-11-18 19:01:40 +01:00
|
|
|
loop:
|
|
|
|
"{{ workflows }}"
|
2020-11-19 11:56:06 +01:00
|
|
|
|
|
|
|
- name: Cleanup target_path
|
|
|
|
file:
|
2020-11-19 12:14:55 +01:00
|
|
|
path: "{{ target.path }}"
|
2020-11-19 11:56:06 +01:00
|
|
|
state: absent
|
2020-11-19 12:14:55 +01:00
|
|
|
when: target is defined
|
2020-11-19 11:56:06 +01:00
|
|
|
|