ansible-role-conductor-work.../tasks/main.yaml

46 lines
1.0 KiB
YAML
Raw Normal View History

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 }}"
- 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 }}"
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
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