From c76ae8a2aca04c9518625cfa02dc128a0d5f2b9b Mon Sep 17 00:00:00 2001 From: Steffen Scheib <92300342+sscheib-rh@users.noreply.github.com> Date: Thu, 15 May 2025 17:55:50 +0200 Subject: [PATCH] docs: Fix schedule documentation (#15972) With the "recent" changes making the lookup plugin `awx.awx.schedule_rrule` and `awx.awx.schedule_rruleset` returning a list instead of string (see #15625), the returned list (which will *always* carry only 1 item) needs to be transformed to a string either adding `| join` or `| first`. I found `first` to be more fitting as the list will *always* return a list with 1 item. Additionally, the documentation that references `awx.awx.schedule_rruleset` in the `awx.awx.schedule` module was wrong, which is also fixed by this PR. Signed-off-by: Steffen Scheib Co-authored-by: Steffen Scheib --- awx_collection/plugins/modules/schedule.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/awx_collection/plugins/modules/schedule.py b/awx_collection/plugins/modules/schedule.py index b2dba8a8df..2d651805a7 100644 --- a/awx_collection/plugins/modules/schedule.py +++ b/awx_collection/plugins/modules/schedule.py @@ -166,7 +166,7 @@ EXAMPLES = ''' name: "{{ sched1 }}" state: present unified_job_template: "Demo Job Template" - rrule: "{{ query('awx.awx.schedule_rrule', 'week', start_date='2019-12-19 13:05:51') }}" + rrule: "{{ query('awx.awx.schedule_rrule', 'week', start_date='2019-12-19 13:05:51') | first }}" register: result - name: Build a complex schedule for every day except sunday using the rruleset plugin @@ -174,14 +174,14 @@ EXAMPLES = ''' name: "{{ sched1 }}" state: present unified_job_template: "Demo Job Template" - rrule: "{{ query(awx.awx.schedule_rruleset, '2022-04-30 10:30:45', rules=rrules, timezone='UTC' ) }}" + rrule: "{{ query(awx.awx.schedule_rruleset, '2022-04-30 10:30:45', rules=rrules, timezone='UTC' ) | first }}" vars: rrules: - frequency: 'day' - every: 1 + interval: 1 - frequency: 'day' - every: 1 - on_days: 'sunday' + interval: 1 + byweekday: 'sunday' include: false - name: Delete 'my_schedule' schedule for my_workflow