Allow modification of schedule if there are two of the same name (#12407)

This commit is contained in:
Tom Page
2022-06-29 00:23:54 +01:00
committed by GitHub
parent c586f8bbc6
commit b70231f7d0
3 changed files with 48 additions and 3 deletions

View File

@@ -163,6 +163,7 @@
- name: Disable a schedule
schedule:
name: "{{ sched1 }}"
unified_job_template: "{{ jt1 }}"
state: present
enabled: "false"
register: result
@@ -188,6 +189,29 @@
rrule: "DTSTART:20191219T130551Z RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=1"
register: result
- name: Verify we can't find the schedule without the UJT lookup
schedule:
name: "{{ sched1 }}"
state: present
rrule: "DTSTART:20201219T130551Z RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=1"
register: result
ignore_errors: true
- assert:
that:
- result is failed
- name: Verify we can find the schedule with the UJT lookup and delete it
schedule:
name: "{{ sched1 }}"
state: absent
unified_job_template: "{{ jt2 }}"
register: result
- assert:
that:
- result is changed
always:
- name: Delete the schedule
schedule: