2018-03-16 18:28:19 +01:00
|
|
|
- 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 }}"
|
2019-01-09 15:31:21 +01:00
|
|
|
|
|
|
|
- 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.'"
|