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:
John Westcott IV
2023-05-10 08:05:29 -04:00
committed by GitHub
parent 53260213ba
commit 7f020052db
40 changed files with 918 additions and 135 deletions

View File

@@ -25,6 +25,39 @@
- assert:
that: "result is changed"
- name: "Create a new organization with exists"
organization:
name: "{{ org_name }}"
galaxy_credentials:
- Ansible Galaxy
state: exists
register: result
- assert:
that: "result is not changed"
- name: "Delete a new organization"
organization:
name: "{{ org_name }}"
galaxy_credentials:
- Ansible Galaxy
state: absent
register: result
- assert:
that: "result is changed"
- name: "Create a new organization with exists"
organization:
name: "{{ org_name }}"
galaxy_credentials:
- Ansible Galaxy
state: exists
register: result
- assert:
that: "result is changed"
- name: "Make sure making the same org is not a change"
organization:
name: "{{ org_name }}"