mirror of
https://github.com/ansible/awx.git
synced 2026-04-10 20:49:24 -02:30
Fix missing alias in argument_spec and add tests for it
This commit is contained in:
@@ -90,7 +90,7 @@ from ..module_utils.tower_api import TowerAPIModule
|
|||||||
def main():
|
def main():
|
||||||
# Any additional arguments that are not fields of the item can be added here
|
# Any additional arguments that are not fields of the item can be added here
|
||||||
argument_spec = dict(
|
argument_spec = dict(
|
||||||
name=dict(required=True),
|
name=dict(required=True, aliases=['inventory_source']),
|
||||||
inventory=dict(required=True),
|
inventory=dict(required=True),
|
||||||
organization=dict(),
|
organization=dict(),
|
||||||
wait=dict(default=False, type='bool'),
|
wait=dict(default=False, type='bool'),
|
||||||
|
|||||||
@@ -97,6 +97,21 @@
|
|||||||
that:
|
that:
|
||||||
- "result is changed"
|
- "result is changed"
|
||||||
|
|
||||||
|
- name: Test Inventory Source Update for All Sources (using inventory_source as alias for name)
|
||||||
|
tower_inventory_source_update:
|
||||||
|
inventory_source: "{{ item.name }}"
|
||||||
|
inventory: "{{ inv_name }}"
|
||||||
|
organization: Default
|
||||||
|
wait: true
|
||||||
|
loop: "{{ query('awx.awx.tower_api', 'inventory_sources', query_params={ 'inventory': created_inventory.id }, expect_objects=True, return_objects=True) }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
|
register: result
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "result is changed"
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Delete Inventory
|
- name: Delete Inventory
|
||||||
tower_inventory:
|
tower_inventory:
|
||||||
|
|||||||
Reference in New Issue
Block a user