summaryrefslogtreecommitdiff
path: root/test/integration/targets/tower_job_cancel/tasks/main.yml
blob: 304e71a84ff5904bfb6de4cf19ad1d5fb3632bc0 (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
- 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: Cancel the job
  tower_job_cancel:
    job_id: "{{ job.id }}"

- name: Check module fails with correct msg
  tower_job_cancel:
    job_id: 9999999999
  register: result
  ignore_errors: true

- assert:
    that:
      - "result.msg =='Unable to cancel job_id/9999999999: The requested object could not be found.'"