mirror of
https://github.com/ansible/awx.git
synced 2026-07-03 12:28:01 -02:30
Make state exists universal in collection (#13890)
Make state: exists available for all API modules Make state:exists return the ID just like it would if it created the resource
This commit is contained in:
@@ -51,6 +51,45 @@
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Create an Inventory with exists
|
||||
inventory:
|
||||
name: "{{ inv_name1 }}"
|
||||
organization: Default
|
||||
instance_groups:
|
||||
- "{{ group_name1 }}"
|
||||
state: exists
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is not changed"
|
||||
|
||||
- name: Delete an Inventory
|
||||
inventory:
|
||||
name: "{{ inv_name1 }}"
|
||||
organization: Default
|
||||
instance_groups:
|
||||
- "{{ group_name1 }}"
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Create an Inventory with exists
|
||||
inventory:
|
||||
name: "{{ inv_name1 }}"
|
||||
organization: Default
|
||||
instance_groups:
|
||||
- "{{ group_name1 }}"
|
||||
state: exists
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Test Inventory module idempotency
|
||||
inventory:
|
||||
name: "{{ result.id }}"
|
||||
|
||||
Reference in New Issue
Block a user