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

31 lines
642 B
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
register: target_path
2020-11-18 19:01:40 +01:00
- name: Generate workflows
template:
src: "templates/{{ item }}.json.j2"
2020-11-19 11:25:33 +01:00
dest: "{{ target_path }}{{ item }}.json"
2020-11-18 19:01:40 +01:00
loop: "{{ workflows }}"
- name: Upload workflows
uri:
url: "{{ conductor_workflowdef_endpoint }}"
method: POST
2020-11-19 11:25:33 +01:00
src: "{{ target_path }}{{ item }}.json"
2020-11-18 19:01:40 +01:00
body_format: json
follow_redirects: yes
status_code: [200, 204, 409]
loop:
"{{ workflows }}"
2020-11-19 11:56:06 +01:00
- name: Cleanup target_path
file:
path: "{{ target_path }}"
state: absent
when: target_path is defined