awx.awx.schedule_rrule lookup – Generate an rrule string which can be used for Schedules

Note

This lookup plugin is part of the awx.awx collection (version 21.8.0).

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_rrule.

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

Terms

string / required

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:

  • "none"

  • "minute"

  • "hour"

  • "day"

  • "week"

  • "month"

Parameters

Parameter

Comments

end_on

string

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 occurences

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

every

integer

The repetition in months, weeks, days hours or minutes

Used for all types except none

month_day_number

integer

The day of the month this schedule will run on (0-31)

Used for month type schedules

Cannot be used with on_the parameter

on_days

string

The days to run this schedule on

A comma-separated list which can contain values sunday, monday, tuesday, wednesday, thursday, friday

Used for week type schedules

on_the

string

A description on when this schedule will run

Two strings separated by a space

First string is one of first, second, third, fourth, last

Second string is one of sunday, monday, tuesday, wednesday, thursday, friday

Used for month type schedules

Cannot be used with month_day_number parameters

start_date

string

The date to start the rule

Used for all frequencies

Format should be YYYY-MM-DD [HH:MM:SS]

timezone

string

The timezone to use for this rule

Used for all frequencies

Format should be as US/Eastern

Defaults to America/New_York

Examples

- name: Create a string for a schedule
  debug:
    msg: "{{ query('awx.awx.schedule_rrule', 'none', start_date='1979-09-13 03:45:07') }}"

Return Value

Key

Description

Return value

string

String in the rrule format

Returned: success

Authors

  • John Westcott IV (@john-westcott-iv)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.