mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
Follow same pattern as project update module, add task to integration test
This commit is contained in:
@@ -135,19 +135,22 @@ def main():
|
|||||||
if inventory_source_update_results['status_code'] != 202:
|
if inventory_source_update_results['status_code'] != 202:
|
||||||
module.fail_json(msg="Failed to update inventory source, see response for details", **{'response': inventory_source_update_results})
|
module.fail_json(msg="Failed to update inventory source, see response for details", **{'response': inventory_source_update_results})
|
||||||
|
|
||||||
if wait:
|
module.json_output['changed'] = True
|
||||||
inventory_source_update_results = module.wait_on_url(
|
module.json_output['id'] = inventory_source_update_results['json']['id']
|
||||||
url=inventory_source_update_results['json']['url'],
|
module.json_output['status'] = inventory_source_update_results['json']['status']
|
||||||
object_name=inventory_object,
|
|
||||||
object_type='inventory_update',
|
|
||||||
timeout=timeout, interval=interval
|
|
||||||
)
|
|
||||||
|
|
||||||
module.exit_json(**{
|
if not wait:
|
||||||
'changed': True,
|
module.exit_json(**module.json_output)
|
||||||
'id': inventory_source_update_results['json']['id'],
|
|
||||||
'status': inventory_source_update_results['json']['status'],
|
# Invoke wait function
|
||||||
})
|
module.wait_on_url(
|
||||||
|
url=inventory_source_update_results['json']['url'],
|
||||||
|
object_name=inventory_object,
|
||||||
|
object_type='inventory_update',
|
||||||
|
timeout=timeout, interval=interval
|
||||||
|
)
|
||||||
|
|
||||||
|
module.exit_json(**module.json_output)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
inv_name: "AWX-Collection-tests-tower_inventory_source_update-inv-{{ test_id }}"
|
inv_name: "AWX-Collection-tests-tower_inventory_source_update-inv-{{ test_id }}"
|
||||||
inv_source1: "AWX-Collection-tests-tower_inventory_source_update-source1-{{ test_id }}"
|
inv_source1: "AWX-Collection-tests-tower_inventory_source_update-source1-{{ test_id }}"
|
||||||
inv_source2: "AWX-Collection-tests-tower_inventory_source_update-source2-{{ test_id }}"
|
inv_source2: "AWX-Collection-tests-tower_inventory_source_update-source2-{{ test_id }}"
|
||||||
|
inv_source3: "AWX-Collection-tests-tower_inventory_source_update-source3-{{ test_id }}"
|
||||||
org_name: "AWX-Collection-tests-tower_inventory_source_update-org-{{ test_id }}"
|
org_name: "AWX-Collection-tests-tower_inventory_source_update-org-{{ test_id }}"
|
||||||
|
|
||||||
|
|
||||||
@@ -60,6 +61,16 @@
|
|||||||
organization: Default
|
organization: Default
|
||||||
inventory: "{{ inv_name }}"
|
inventory: "{{ inv_name }}"
|
||||||
|
|
||||||
|
- name: Create Yet Another Inventory Source (one more to make lookup plugin find multiple inventory sources)
|
||||||
|
tower_inventory_source:
|
||||||
|
name: "{{ inv_source3 }}"
|
||||||
|
source: scm
|
||||||
|
source_project: "{{ project_name }}"
|
||||||
|
source_path: inventories/create_100_hosts.ini
|
||||||
|
description: Source for Test inventory
|
||||||
|
organization: Default
|
||||||
|
inventory: "{{ inv_name }}"
|
||||||
|
|
||||||
- name: Test Inventory Source Update
|
- name: Test Inventory Source Update
|
||||||
tower_inventory_source_update:
|
tower_inventory_source_update:
|
||||||
inventory: "{{ inv_name }}"
|
inventory: "{{ inv_name }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user