Update awx collection workflow nodes to look for type (#12597)

This commit is contained in:
Sean Sullivan 2022-08-11 07:08:27 -04:00 committed by GitHub
parent 85a5b58d18
commit 8cf75fce8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 4 deletions

View File

@ -261,7 +261,7 @@ options:
type:
description:
- Name of unified job template type to run in the workflow.
- Can be a job_template, project, inventory_source, system_job, workflow_approval, workflow_job_template.
- Can be a job_template, project, inventory_source, system_job_template, workflow_approval, workflow_job_template.
type: str
timeout:
description:
@ -489,6 +489,7 @@ def create_workflow_nodes(module, response, workflow_nodes, workflow_id):
if workflow_node['unified_job_template']['name']:
if workflow_node['unified_job_template']['type'] is None:
module.fail_json(msg='Could not find unified job template type in workflow_nodes {1}'.format(workflow_node))
search_fields['type'] = workflow_node['unified_job_template']['type']
if workflow_node['unified_job_template']['type'] == 'inventory_source':
if 'inventory' in workflow_node['unified_job_template']:
if 'organization' in workflow_node['unified_job_template']['inventory']:

View File

@ -110,6 +110,20 @@
that:
- "result is changed"
- name: Create a 3rd Demo Project in another org with inventory source name
project:
name: "{{ project_inv_source }}"
organization: "{{ org_name }}"
state: present
scm_type: git
scm_url: https://github.com/ansible/ansible-tower-samples.git
scm_credential: "{{ scm_cred_name }}"
register: result
- assert:
that:
- "result is changed"
- name: Add an inventory
inventory:
description: Test inventory
@ -573,8 +587,8 @@
- identifier: node202
unified_job_template:
organization:
name: Default
name: "{{ demo_project_name }}"
name: "{{ org_name }}"
name: "{{ project_inv_source }}"
type: project
- all_parents_must_converge: false
identifier: node301
@ -586,7 +600,7 @@
- identifier: Cleanup Job
unified_job_template:
name: Cleanup Activity Stream
type: system_job
type: system_job_template
register: result
- assert:
@ -761,6 +775,16 @@
state: absent
ignore_errors: True
- name: Delete the 3rd Demo Project
project:
name: "{{ project_inv_source }}"
organization: "{{ org_name }}"
scm_type: git
scm_url: https://github.com/ansible/ansible-tower-samples.git
scm_credential: "{{ scm_cred_name }}"
state: absent
ignore_errors: True
- name: Delete the SCM Credential
credential:
name: "{{ scm_cred_name }}"