mirror of
https://github.com/ansible/awx.git
synced 2026-03-21 19:07:39 -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:
@@ -22,6 +22,48 @@
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Add an EE with exists
|
||||
execution_environment:
|
||||
name: "{{ ee_name }}"
|
||||
description: "EE for Testing"
|
||||
image: quay.io/ansible/awx-ee
|
||||
pull: always
|
||||
organization: Default
|
||||
state: exists
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is not changed"
|
||||
|
||||
- name: Delete an EE
|
||||
execution_environment:
|
||||
name: "{{ ee_name }}"
|
||||
description: "EE for Testing"
|
||||
image: quay.io/ansible/awx-ee
|
||||
pull: always
|
||||
organization: Default
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Add an EE with exists
|
||||
execution_environment:
|
||||
name: "{{ ee_name }}"
|
||||
description: "EE for Testing"
|
||||
image: quay.io/ansible/awx-ee
|
||||
pull: always
|
||||
organization: Default
|
||||
state: exists
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Associate the Test EE with Default Org (this should fail)
|
||||
execution_environment:
|
||||
name: "{{ ee_name }}"
|
||||
|
||||
Reference in New Issue
Block a user