summaryrefslogtreecommitdiff
path: root/test/integration/targets/tower_job_launch/tasks/main.yml
diff options
context:
space:
mode:
authorHideki Saito <saito@fgrep.org>2019-04-09 22:08:11 +0900
committerJohn R Barker <john@johnrbarker.com>2019-04-09 14:08:11 +0100
commit377fba3d766a57957f5b1f56f03e98ecddbb7844 (patch)
treee9ecb0aa5587d9cd454d01f3b131beceda325b81 /test/integration/targets/tower_job_launch/tasks/main.yml
parent5cbac14469da45995602c4911b6315f4a0638514 (diff)
downloadansible-377fba3d766a57957f5b1f56f03e98ecddbb7844.tar.gz
Fix handling of inventory and credential options for tower_job_launch (#54967)
- Fixed issue #25017,#37567 - Add example for prompt on launch - Add integration test for prompt on launch Signed-off-by: Hideki Saito <saito@fgrep.org>
Diffstat (limited to 'test/integration/targets/tower_job_launch/tasks/main.yml')
-rw-r--r--test/integration/targets/tower_job_launch/tasks/main.yml35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/integration/targets/tower_job_launch/tasks/main.yml b/test/integration/targets/tower_job_launch/tasks/main.yml
index 9bf271c105..7550377905 100644
--- a/test/integration/targets/tower_job_launch/tasks/main.yml
+++ b/test/integration/targets/tower_job_launch/tasks/main.yml
@@ -10,6 +10,18 @@
- "result is changed"
- "result.status == 'pending'"
+- name: Wait for a job template to complete
+ tower_job_wait:
+ job_id: "{{ result.id }}"
+ max_interval: 10
+ timeout: 120
+ register: result
+
+- assert:
+ that:
+ - "result is not changed"
+ - "result.status == 'successful'"
+
- name: Check module fails with correct msg
tower_job_launch:
job_template: "Non Existing Job Template"
@@ -21,3 +33,26 @@
- assert:
that:
- "result.msg =='Unable to launch job, job_template/Non Existing Job Template was not found: The requested object could not be found.'"
+
+- name: Create a Job Template for testing prompt on launch
+ tower_job_template:
+ name: "Demo Job Template - ask inventory and credential"
+ project: Demo Project
+ playbook: hello_world.yml
+ job_type: run
+ ask_credential: yes
+ ask_inventory: yes
+ state: present
+ register: result
+
+- name: Launch job template with inventory and credential for prompt on launch
+ tower_job_launch:
+ job_template: "Demo Job Template - ask inventory and credential"
+ inventory: "Demo Inventory"
+ credential: "Demo Credential"
+ register: result
+
+- assert:
+ that:
+ - "result is changed"
+ - "result.status == 'pending'"