2019-01-18 12:08:04 +01:00
|
|
|
- name: Get unified job template ID for Demo Job Template"
|
|
|
|
uri:
|
2019-03-01 03:25:49 +01:00
|
|
|
url: "https://{{ tower_host }}/api/v2/unified_job_templates/?name=Demo+Job+Template"
|
2019-01-18 12:08:04 +01:00
|
|
|
method: GET
|
2019-03-01 03:25:49 +01:00
|
|
|
password: "{{ tower_password }}"
|
|
|
|
user: "{{ tower_username }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
validate_certs: False
|
2020-02-13 19:13:05 +01:00
|
|
|
force_basic_auth: true
|
2019-01-18 12:08:04 +01:00
|
|
|
register: unified_job
|
|
|
|
|
|
|
|
- name: Build workflow
|
|
|
|
uri:
|
2019-03-01 03:25:49 +01:00
|
|
|
url: "https://{{ tower_host }}/api/v2/workflow_job_templates/"
|
2019-01-18 12:08:04 +01:00
|
|
|
body:
|
|
|
|
name: "Success Template"
|
|
|
|
variables: "---"
|
|
|
|
extra_vars: ""
|
|
|
|
body_format: 'json'
|
|
|
|
method: 'POST'
|
2019-03-01 03:25:49 +01:00
|
|
|
password: "{{ tower_password }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
status_code: 201
|
2019-03-01 03:25:49 +01:00
|
|
|
user: "{{ tower_username }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
validate_certs: False
|
2020-02-13 19:13:05 +01:00
|
|
|
force_basic_auth: true
|
2019-01-18 12:08:04 +01:00
|
|
|
register: workflow
|
|
|
|
|
|
|
|
- name: Add a node
|
|
|
|
uri:
|
2019-03-01 03:25:49 +01:00
|
|
|
url: "https://{{ tower_host }}/api/v2/workflow_job_templates/{{ workflow.json.id }}/workflow_nodes/"
|
2019-01-18 12:08:04 +01:00
|
|
|
body:
|
|
|
|
credential: null
|
|
|
|
diff_mode: null
|
|
|
|
extra_data: {}
|
|
|
|
inventory: null
|
|
|
|
job_tags: null
|
|
|
|
job_type: null
|
|
|
|
limit: null
|
|
|
|
skip_tags: null
|
|
|
|
unified_job_template: "{{ unified_job.json.results[0].id }}"
|
|
|
|
verbosity: null
|
|
|
|
body_format: 'json'
|
|
|
|
method: 'POST'
|
2019-03-01 03:25:49 +01:00
|
|
|
password: "{{ tower_password }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
status_code: 201
|
2019-03-01 03:25:49 +01:00
|
|
|
user: "{{ tower_username }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
validate_certs: False
|
2020-02-13 19:13:05 +01:00
|
|
|
force_basic_auth: true
|
2019-01-18 12:08:04 +01:00
|
|
|
register: node1
|
|
|
|
|
|
|
|
- name: Add a node
|
|
|
|
uri:
|
2019-03-01 03:25:49 +01:00
|
|
|
url: "https://{{ tower_host }}/api/v2/workflow_job_templates/{{ workflow.json.id }}/workflow_nodes/"
|
2019-01-18 12:08:04 +01:00
|
|
|
body:
|
|
|
|
credential: null
|
|
|
|
diff_mode: null
|
|
|
|
extra_data: {}
|
|
|
|
inventory: null
|
|
|
|
job_tags: null
|
|
|
|
job_type: null
|
|
|
|
limit: null
|
|
|
|
skip_tags: null
|
|
|
|
unified_job_template: "{{ unified_job.json.results[0].id }}"
|
|
|
|
verbosity: null
|
|
|
|
body_format: 'json'
|
|
|
|
method: 'POST'
|
2019-03-01 03:25:49 +01:00
|
|
|
password: "{{ tower_password }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
status_code: 201
|
2019-03-01 03:25:49 +01:00
|
|
|
user: "{{ tower_username }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
validate_certs: False
|
2020-02-13 19:13:05 +01:00
|
|
|
force_basic_auth: true
|
2019-01-18 12:08:04 +01:00
|
|
|
register: node2
|
|
|
|
|
|
|
|
- name: "Link nodes {{ node2.json.id }} to {{ node1.json.id }}"
|
|
|
|
uri:
|
2019-03-01 03:25:49 +01:00
|
|
|
url: "https://{{ tower_host }}/api/v2/workflow_job_template_nodes/{{ node1.json.id }}/success_nodes/"
|
2019-01-18 12:08:04 +01:00
|
|
|
body: '{ "id": {{ node2.json.id }} }'
|
|
|
|
body_format: 'json'
|
|
|
|
method: 'POST'
|
2019-03-01 03:25:49 +01:00
|
|
|
password: "{{ tower_password }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
status_code: 204
|
2019-03-01 03:25:49 +01:00
|
|
|
user: "{{ tower_username }}"
|
2019-01-18 12:08:04 +01:00
|
|
|
validate_certs: False
|
2020-02-13 19:13:05 +01:00
|
|
|
force_basic_auth: true
|