mirror of
https://github.com/ansible/awx.git
synced 2026-05-15 05:17:36 -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:
@@ -76,6 +76,42 @@
|
||||
that:
|
||||
- result is changed
|
||||
|
||||
- name: Build a real schedule with exists
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: exists
|
||||
unified_job_template: "Demo Job Template"
|
||||
rrule: "DTSTART:20191219T130551Z RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=1"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is not changed
|
||||
|
||||
- name: Delete a real schedule
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: absent
|
||||
unified_job_template: "Demo Job Template"
|
||||
rrule: "DTSTART:20191219T130551Z RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=1"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
|
||||
- name: Build a real schedule with exists
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
state: exists
|
||||
unified_job_template: "Demo Job Template"
|
||||
rrule: "DTSTART:20191219T130551Z RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=1"
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- result is changed
|
||||
|
||||
- name: Rebuild the same schedule
|
||||
schedule:
|
||||
name: "{{ sched1 }}"
|
||||
|
||||
Reference in New Issue
Block a user