awx.awx.schedule_rruleset lookup – Generate an rruleset string
Note
This lookup plugin is part of the awx.awx collection (version 24.6.1).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install awx.awx
.
You need further requirements to be able to use this lookup plugin,
see Requirements for details.
To use it in a playbook, specify: awx.awx.schedule_rruleset
.
Synopsis
Returns a string based on criteria which represents an rrule
Requirements
The below requirements are needed on the local controller node that executes this lookup.
pytz
python-dateutil >= 2.7.0
Terms
Parameter |
Comments |
---|---|
The start date of the ruleset Used for all frequencies Format should be YYYY-MM-DD [HH:MM:SS] |
Keyword parameters
This describes keyword parameters of the lookup. These are the values key1=value1
, key2=value2
and so on in the following
examples: lookup('awx.awx.schedule_rruleset', key1=value1, key2=value2, ...)
and query('awx.awx.schedule_rruleset', key1=value1, key2=value2, ...)
Parameter |
Comments |
---|---|
Array of rules in the rruleset |
|
The hours to run this schedule on A comma-separated list which can contain values 0-23 |
|
The minutes to run this schedule on A comma-separated list which can contain values 0-59 |
|
The months this schedule will run on A comma-separated list which can contain values 0-12 |
|
The day of the month this schedule will run on A comma-separated list which can contain values 0-31 |
|
Specify an occurrence number, corresponding to the nth occurrence of the rule inside the frequency period. A comma-separated list of positions (first, second, third, forth or last) |
|
The days to run this schedule on A comma-separated list which can contain values sunday, monday, tuesday, wednesday, thursday, friday |
|
The week numbers to run this schedule on A comma-separated list which can contain values as described in ISO8601 |
|
The year day numbers to run this schedule on A comma-separated list which can contain values 0-366 |
|
How to end this schedule If this is not defined, this schedule will never end If this is a positive integer, this schedule will end after this number of occurrences If this is a date in the format YYYY-MM-DD [HH:MM:SS], this schedule ends after this date Used for all types except none |
|
The frequency of the schedule none - Run this schedule once minute - Run this schedule every x minutes hour - Run this schedule every x hours day - Run this schedule every x days week - Run this schedule weekly month - Run this schedule monthly Choices:
|
|
If this rule should be included (RRULE) or excluded (EXRULE) Choices:
|
|
The repetition in months, weeks, days hours or minutes Used for all types except none |
|
The timezone to use for this rule Used for all frequencies Format should be as US/Eastern Defaults to America/New_York |
Notes
Note
When keyword and positional parameters are used together, positional parameters must be listed before keyword parameters:
lookup('awx.awx.schedule_rruleset', term1, term2, key1=value1, key2=value2)
andquery('awx.awx.schedule_rruleset', term1, term2, key1=value1, key2=value2)
Examples
- name: Create a ruleset for everyday except Sundays
set_fact:
complex_rule: "{{ query(awx.awx.schedule_rruleset, '2022-04-30 10:30:45', rules=rrules, timezone='UTC' ) }}"
vars:
rrules:
- frequency: 'day'
interval: 1
- frequency: 'day'
interval: 1
byweekday: 'sunday'
include: False
Return Value
Key |
Description |
---|---|
String in the rrule format Returned: success |