mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-03 23:14:02 -07:00
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>
This commit is contained in:
parent
5cbac14469
commit
377fba3d76
4 changed files with 60 additions and 5 deletions
|
@ -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'"
|
||||
|
|
|
@ -69,6 +69,8 @@ class TowerCloudProvider(CloudProvider):
|
|||
tower_cli_version_map = {
|
||||
'3.1.5': '3.1.8',
|
||||
'3.2.3': '3.3.0',
|
||||
'3.3.5': '3.3.3',
|
||||
'3.4.3': '3.3.3',
|
||||
}
|
||||
|
||||
cli_version = tower_cli_version_map.get(self.version, fallback)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue