awx.awx.schedule module – create, update, or destroy Automation Platform Controller schedules.

Note

This module is part of the awx.awx collection (version 19.4.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.

To use it in a playbook, specify: awx.awx.schedule.

Synopsis

Parameters

Parameter

Comments

controller_config_file

aliases: tower_config_file

path

Path to the controller config file.

If provided, the other locations for config files will not be considered.

controller_host

aliases: tower_host

string

URL to your Automation Platform Controller instance.

If value not set, will try environment variable CONTROLLER_HOST and then config files

If value not specified by any means, the value of 127.0.0.1 will be used

controller_oauthtoken

aliases: tower_oauthtoken

raw

added in 3.7.0 of awx.awx

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 CONTROLLER_OAUTH_TOKEN and then config files

controller_password

aliases: tower_password

string

Password for your controller instance.

If value not set, will try environment variable CONTROLLER_PASSWORD and then config files

controller_username

aliases: tower_username

string

Username for your controller instance.

If value not set, will try environment variable CONTROLLER_USERNAME and then config files

credentials

list / elements=string

List of credentials applied as a prompt, assuming job template prompts for credentials

description

string

Optional description of this schedule.

diff_mode

boolean

Enable diff mode for the job template.

Choices:

  • no

  • yes

enabled

boolean

Enables processing of this schedule.

Choices:

  • no

  • yes

extra_data

dictionary

Specify extra_vars for the template.

Default: {}

inventory

string

Inventory applied as a prompt, assuming job template prompts for inventory

job_tags

string

Comma separated list of the tags to use for the job template.

job_type

string

The job type to use for the job template.

Choices:

  • run

  • check

limit

string

A host pattern to further constrain the list of hosts managed or affected by the playbook

name

string / required

Name of this schedule.

new_name

string

Setting this option will change the existing name (looked up via the name field.

organization

string

The organization the unified job template exists in.

Used for looking up the unified job template, not a direct model field.

rrule

string

A value representing the schedules iCal recurrence rule.

See rrule plugin for help constructing this value

scm_branch

string

Branch to use in job run. Project default used if blank. Only allowed if project allow_override field is set to true.

skip_tags

string

Comma separated list of the tags to skip for the job template.

state

string

Desired state of the resource.

Choices:

  • present ← (default)

  • absent

unified_job_template

string

Name of unified job template to schedule.

validate_certs

aliases: tower_verify_ssl

boolean

Whether to allow insecure connections to AWX.

If no, SSL certificates will not be validated.

This should only be used on personally controlled sites using self-signed certificates.

If value not set, will try environment variable CONTROLLER_VERIFY_SSL and then config files

Choices:

  • no

  • yes

verbosity

integer

Control the output level Ansible produces as the playbook runs. 0 - Normal, 1 - Verbose, 2 - More Verbose, 3 - Debug, 4 - Connection Debug.

Choices:

  • 0

  • 1

  • 2

  • 3

  • 4

  • 5

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

Authors

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