mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 05:45:02 -02:30
Merge pull request #10573 from Tompage1994/collection_inv_src_proj
Default source_project to organization for inventory source
This commit is contained in:
@@ -256,7 +256,10 @@ def main():
|
|||||||
if ee is not None:
|
if ee is not None:
|
||||||
inventory_source_fields['execution_environment'] = module.resolve_name_to_id('execution_environments', ee)
|
inventory_source_fields['execution_environment'] = module.resolve_name_to_id('execution_environments', ee)
|
||||||
if source_project is not None:
|
if source_project is not None:
|
||||||
inventory_source_fields['source_project'] = module.resolve_name_to_id('projects', source_project)
|
source_project_object = module.get_one('projects', name_or_id=source_project, data=lookup_data)
|
||||||
|
if not source_project_object:
|
||||||
|
module.fail_json(msg='The specified source project, {0}, was not found.'.format(lookup_data))
|
||||||
|
inventory_source_fields['source_project'] = source_project_object['id']
|
||||||
|
|
||||||
OPTIONAL_VARS = (
|
OPTIONAL_VARS = (
|
||||||
'description',
|
'description',
|
||||||
|
|||||||
@@ -28,6 +28,14 @@
|
|||||||
scm_url: https://github.com/ansible/test-playbooks
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
wait: true
|
wait: true
|
||||||
|
|
||||||
|
- name: Create a git project with same name, different org
|
||||||
|
project:
|
||||||
|
name: "{{ project_name }}"
|
||||||
|
organization: Default
|
||||||
|
scm_type: git
|
||||||
|
scm_url: https://github.com/ansible/test-playbooks
|
||||||
|
wait: true
|
||||||
|
|
||||||
- name: Create an Inventory
|
- name: Create an Inventory
|
||||||
inventory:
|
inventory:
|
||||||
name: "{{ inv_name }}"
|
name: "{{ inv_name }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user