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

46 lines
1.0 KiB
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
force_basic_auth: yes
url_username: "{{ user }}"
url_password: "{{ password }}"
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
force_basic_auth: yes
url_username: "{{ user }}"
url_password: "{{ password }}"
follow_redirects: yes
status_code: [200, 204]
loop:
"{{ workflows }}"
- name: Cleanup target_path
file:
path: "{{ target.path }}"
state: absent
when: target is defined