-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path30_fetch_any_job_template_data.yml
41 lines (35 loc) · 1.21 KB
/
30_fetch_any_job_template_data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
- name: "Fetch Running Time Details From Tower"
hosts: localhost
gather_facts: true
# ignore_errors: true
# ignore_unreachable: true
vars:
ansible_python_interpreter: python
my_job_id: "2135263"
tasks:
- name: "Print Password"
ansible.builtin.debug:
msg:
- "{{ lookup('env', 'Endpoint_USERNAME') }}"
- "{{ lookup('env', 'Endpoint_PASSWORD') }}"
- name: "First - Fetching Job Details - AAP"
ansible.builtin.uri:
url: "{{ lookup('env', 'TOWER_HOST') }}/api/v2/workflow_jobs/{{ my_job_id }}"
method: GET
user: "{{ lookup('env', 'TOWER_USERNAME') }}"
password: "{{ lookup('env', 'TOWER_PASSWORD') }}"
body_format: json
status_code: 201, 200
force_basic_auth: true
validate_certs: false
use_proxy: false
register: get_job_data
delegate_to: localhost
no_log: false
become: false
- name: "Set-Fact 'my_job_id_extra_var'"
ansible.builtin.set_fact:
my_extra_var: "{{ get_job_data.json.extra_vars }}"
- name: "Set-Fact 'storage_details' For Current Play Input"
ansible.builtin.set_fact:
storage_details: "{{ my_extra_var.storage_device }}"