awx.awx.tower_job_template – create, update, or destroy Ansible Tower job templates.

From Get docs
Ansible/docs/2.11/collections/awx/awx/tower job template module


awx.awx.tower_job_template – create, update, or destroy Ansible Tower job templates.

Note

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

To install it use: ansible-galaxy collection install awx.awx.

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


Synopsis

Parameters

Parameter Choices/Defaults Comments

allow_simultaneous

boolean

  • no

  • yes

Allow simultaneous runs of the job template.


aliases: concurrent_jobs_enabled

ask_credential_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user for credential on launch.


aliases: ask_credential

ask_diff_mode_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user to enable diff mode (show changes) to files when supported by modules.


aliases: ask_diff_mode

ask_inventory_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user for inventory on launch.


aliases: ask_inventory

ask_job_type_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user for job type on launch.


aliases: ask_job_type

ask_limit_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user for a limit on launch.


aliases: ask_limit

ask_scm_branch_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user for (scm branch) on launch.

ask_skip_tags_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user for job tags to skip on launch.


aliases: ask_skip_tags

ask_tags_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user for job tags on launch.


aliases: ask_tags

ask_variables_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user for (extra_vars) on launch.


aliases: ask_extra_vars

ask_verbosity_on_launch

boolean

  • no
  • yes

Default:

"False"

Prompt user to choose a verbosity level on launch.


aliases: ask_verbosity

become_enabled

boolean

  • no

  • yes

Activate privilege escalation.

credential

string

Name of the credential to use for the job template.

Deprecated, use 'credentials'.

credentials

list / elements=string

List of credentials to use for the job template.

custom_virtualenv

string

Local absolute file path containing a custom Python virtualenv to use.

description

string

Description to use for the job template.

diff_mode

boolean

  • no

  • yes

Enable diff mode for the job template.


aliases: diff_mode_enabled

extra_vars

dictionary

Specify extra_vars for the template.

force_handlers

boolean

  • no

  • yes

Enable forcing playbook handlers to run even if a task fails.


aliases: force_handlers_enabled

forks

integer

The number of parallel or simultaneous processes to use while executing the playbook.

host_config_key

string

Allow provisioning callbacks using this host config key.

inventory

string

Name of the inventory to use for the job template.

job_slice_count

integer

Default:

"1"

The number of jobs to slice into at runtime. Will cause the Job Template to launch a workflow if value is greater than 1.

job_tags

string

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

job_type

string

  • run
  • check

The job type to use for the job template.

labels

list / elements=string

The labels applied to this job template

limit

string

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

name

string / required

Name to use for the job template.

new_name

string

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

notification_templates_error

list / elements=string

list of notifications to send on error

notification_templates_started

list / elements=string

list of notifications to send on start

notification_templates_success

list / elements=string

list of notifications to send on success

organization

string

Organization the job template exists in.

Used to help lookup the object, cannot be modified using this module.

The Organization is inferred from the associated project

If not provided, will lookup by name only, which does not work with duplicates.

Requires Tower Version 3.7.0 or AWX 10.0.0 IS NOT backwards compatible with earlier versions.

playbook

string

Path to the playbook to use for the job template within the project provided.

project

string

Name of the project to use for the job template.

scm_branch

string

Default:

""

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.

start_at_task

string

Start the playbook at the task matching this name.

state

string

  • present

  • absent

Desired state of the resource.

survey_enabled

boolean

  • no

  • yes

Enable a survey on the job template.

survey_spec

dictionary

JSON/YAML dict formatted survey definition.

timeout

integer

Maximum time in seconds to wait for a job to finish (server-side).

tower_config_file

path

Path to the Tower or AWX config file.

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

tower_host

string

URL to your Tower or AWX instance.

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

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

tower_oauthtoken

raw

added in 3.7 of awx.awx

The Tower 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 tower_token module.

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

tower_password

string

Password for your Tower or AWX instance.

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

tower_username

string

Username for your Tower or AWX instance.

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

use_fact_cache

boolean

  • no

  • yes

Enable use of fact caching for the job template.


aliases: fact_caching_enabled

validate_certs

boolean

  • no
  • yes

Whether to allow insecure connections to Tower or 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 TOWER_VERIFY_SSL and then config files


aliases: tower_verify_ssl

vault_credential

string

Name of the vault credential to use for the job template.

Deprecated, use 'credentials'.

verbosity

integer

  • 0
  • 1
  • 2
  • 3
  • 4

Default:

0

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

webhook_credential

string

Personal Access Token for posting back the status to the service API

webhook_service

string

  • github
  • gitlab

Service that webhook requests will be accepted from



Notes

Note


Examples

- name: Create Tower Ping job template
  tower_job_template:
    name: "Ping"
    job_type: "run"
    organization: "Default"
    inventory: "Local"
    project: "Demo"
    playbook: "ping.yml"
    credentials:
      - "Local"
    state: "present"
    tower_config_file: "~/tower_cli.cfg"
    survey_enabled: yes
    survey_spec: "{{ lookup('file', 'my_survey.json') }}"
    custom_virtualenv: "/var/lib/awx/venv/custom-venv/"

- name: Add start notification to Job Template
  tower_job_template:
    name: "Ping"
    notification_templates_started:
      - Notification1
      - Notification2

- name: Remove Notification1 start notification from Job Template
  tower_job_template:
    name: "Ping"
    notification_templates_started:
      - Notification2

Authors

  • Wayne Witzel III (@wwitzel3)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.11/collections/awx/awx/tower_job_template_module.html