awx.awx.schedule module – create, update, or destroy Automation Platform Controller schedules.
Note
This module 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
.
To use it in a playbook, specify: awx.awx.schedule
.
Synopsis
Create, update, or destroy Automation Platform Controller schedules. See https://www.ansible.com/tower for an overview.
Aliases: tower_schedule
Parameters
Parameter |
Comments |
---|---|
Path to the controller config file. If provided, the other locations for config files will not be considered. |
|
URL to your Automation Platform Controller instance. If value not set, will try environment variable If value not specified by any means, the value of |
|
The OAuth token to use. This value can be in one of two formats. A string which is the token itself. (i.e. bqV5txm97wqJqtkxlMkhQz0pKhRMMX) A dictionary structure as returned by the token module. If value not set, will try environment variable |
|
Password for your controller instance. If value not set, will try environment variable |
|
Username for your controller instance. If value not set, will try environment variable |
|
List of credential names, IDs, or named URLs applied as a prompt, assuming job template prompts for credentials |
|
Optional description of this schedule. |
|
Enable diff mode for the job template. Choices:
|
|
Enables processing of this schedule. Choices:
|
|
Execution Environment name, ID, or named URL applied as a prompt, assuming job template prompts for execution environment |
|
Specify |
|
Forks applied as a prompt, assuming job template prompts for forks |
|
List of Instance Group names, IDs, or named URLs applied as a prompt, assuming job template prompts for instance groups |
|
Inventory name, ID, or named URL applied as a prompt, assuming job template prompts for inventory |
|
Job Slice Count applied as a prompt, assuming job template prompts for job slice count |
|
Comma separated list of the tags to use for the job template. |
|
The job type to use for the job template. Choices:
|
|
List of labels applied as a prompt, assuming job template prompts for labels |
|
A host pattern to further constrain the list of hosts managed or affected by the playbook |
|
Name of this schedule. |
|
Setting this option will change the existing name (looked up via the name field. |
|
The organization name, ID, or named URL the unified job template exists in. Used for looking up the unified job template, not a direct model field. |
|
Specify the timeout Ansible should use in requests to the controller host. Defaults to 10s, but this is handled by the shared module_utils code |
|
A value representing the schedules iCal recurrence rule. See rrule plugin for help constructing this value |
|
Branch to use in job run. Project default used if blank. Only allowed if project allow_override field is set to true. |
|
Comma separated list of the tags to skip for the job template. |
|
Desired state of the resource. Choices:
|
|
Timeout applied as a prompt, assuming job template prompts for timeout |
|
Name, ID, or named URL of unified job template to schedule. Used to look up an already existing schedule. |
|
Whether to allow insecure connections to AWX. If This should only be used on personally controlled sites using self-signed certificates. If value not set, will try environment variable Choices:
|
|
Control the output level Ansible produces as the playbook runs. 0 - Normal, 1 - Verbose, 2 - More Verbose, 3 - Debug, 4 - Connection Debug. Choices:
|
Notes
Note
If no config_file is provided we will attempt to use the tower-cli library defaults to find your host information.
config_file should be in the following format host=hostname username=username password=password
Examples
- name: Build a schedule for Demo Job Template
schedule:
name: "{{ sched1 }}"
state: present
unified_job_template: "Demo Job Template"
rrule: "DTSTART:20191219T130551Z RRULE:FREQ=WEEKLY;INTERVAL=1;COUNT=1"
register: result
- name: Build the same schedule using the rrule plugin
schedule:
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') }}"
register: result
- name: Build a complex schedule for every day except sunday using the rruleset plugin
schedule:
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' ) }}"
vars:
rrules:
- frequency: 'day'
every: 1
- frequency: 'day'
every: 1
on_days: 'sunday'
include: False
- name: Delete 'my_schedule' schedule for my_workflow
schedule:
name: "my_schedule"
state: absent
unified_job_template: my_workflow