summaryrefslogtreecommitdiff
path: root/test/integration/targets/tower_job_wait/tasks/main.yml
blob: 2ffc5bca3aa039d517df495e486ba5b2b97be84b (plain)
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
- name: Launch a Job Template
  tower_job_launch:
    job_template: "Demo Job Template"
    inventory: "Demo Inventory"
    credential: "Demo Credential"
  register: job

- assert:
    that:
      - "job is changed"
      - "job.status == 'pending'"

- name: Wait for the Job to finish
  tower_job_wait:
    job_id: "{{ job.id }}"
    timeout: 60

- name: Check module fails with correct msg
  tower_job_wait:
    job_id: "99999999"
  register: result
  ignore_errors: true

- assert:
    that:
      - "result.msg =='Unable to wait, no job_id 99999999 found: The requested object could not be found.'"