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

40 lines
859 B
YAML

---
- name: Create temporary build directory
tempfile:
state: directory
suffix: build
register: target
- name: Generate workflows
template:
src: "templates/{{ item }}.json.j2"
dest: "{{ target.path }}/{{ item }}.json"
loop: "{{ workflows }}"
- name: Undeploy previous versions of workflows
uri:
url: "{{ conductor_workflowdef_endpoint }}/{{ item }}/1"
method: DELETE
follow_redirects: yes
status_code: [200, 204, 404, 500]
loop:
"{{ workflows }}"
- name: Upload workflows
uri:
url: "{{ conductor_workflowdef_endpoint }}"
method: POST
src: "{{ target.path }}/{{ item }}.json"
body_format: json
follow_redirects: yes
status_code: [200, 204]
loop:
"{{ workflows }}"
- name: Cleanup target_path
file:
path: "{{ target.path }}"
state: absent
when: target is defined