awx.awx.workflow_job_template module – create, update, or destroy Automation Platform Controller workflow job templates.
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.workflow_job_template
.
Synopsis
Create, update, or destroy Automation Platform Controller workflow job templates.
Use workflow_job_template_node after this, or use the workflow_nodes parameter to build the workflow’s graph
Aliases: tower_workflow_job_template
Parameters
Parameter |
Comments |
---|---|
Allow simultaneous runs of the workflow job template. Choices:
|
|
Prompt user for inventory on launch of this workflow job template Choices:
|
|
Prompt user for labels on launch. Choices:
|
|
Prompt user for limit on launch of this workflow job template Choices:
|
|
Prompt user for SCM branch on launch of this workflow job template Choices:
|
|
Prompt user for job tags to skip on launch. Choices:
|
|
Prompt user for job tags on launch. Choices:
|
|
Prompt user for Choices:
|
|
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 |
|
Name or id to copy the workflow job template from. This will copy an existing workflow job template and change any parameters supplied. The new workflow job template name will be the one provided in the name parameter. The organization parameter is not used in this, to facilitate copy from one organization to another. Provide the id or use the lookup plugin to provide the id if multiple workflow job templates share the same name. |
|
Optional description of this workflow job template. |
|
Set in order to destroy current workflow_nodes on the workflow. This option is used for full workflow update, if not used, nodes not described in workflow will persist and keep current associations and links. Choices:
|
|
Variables which will be made available to jobs ran inside the workflow. |
|
Name, ID, or named URL of inventory applied as a prompt, assuming job template prompts for inventory |
|
Comma separated list of the tags to use for the job template. |
|
The labels applied to this job template Must be created with the labels module first. This will error if the label has not been created. |
|
Limit applied as a prompt, assuming job template prompts for limit |
|
Name of this workflow job template. |
|
Setting this option will change the existing name. |
|
list of notifications to send on approval |
|
list of notifications to send on error |
|
list of notifications to send on start |
|
list of notifications to send on success |
|
Organization name, ID, or named URL the workflow job template exists in. Used to help lookup the object, cannot be modified using this module. If not provided, will lookup by name only, which does not work with duplicates. |
|
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 |
|
SCM branch applied as a prompt, assuming job template prompts for SCM branch |
|
Comma separated list of the tags to skip for the job template. |
|
Desired state of the resource. Choices:
|
|
Setting that variable will prompt the user for job type on the workflow launch. Choices:
|
|
The definition of the survey associated to the workflow. |
|
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:
|
|
Personal Access Token for posting back the status to the service API |
|
Service that webhook requests will be accepted from Choices:
|
|
A json list of nodes and their coresponding options. The following suboptions describe a single node. |
|
If enabled then the node will only run if all of the parent nodes have met the criteria to reach this node Choices:
|
|
Run diff mode, applied as a prompt, if job template prompts for diff mode Choices:
|
|
Name of Execution Environment to be applied to job as launch-time prompts. |
|
Name of Execution Environment to be applied to job as launch-time prompts. Uniqueness is not handled rigorously. |
|
Variables to apply at launch time. Will only be accepted if job template prompts for vars or has a survey asking for those vars. Default: |
|
The number of parallel or simultaneous processes to use while executing the playbook, if job template prompts for forks |
|
An identifier for this node that is unique within its workflow. It is copied to workflow job nodes corresponding to this node. |
|
Inventory applied as a prompt, if job template prompts for inventory |
|
Name Inventory to be applied to job as launch-time prompts. |
|
Name of key for use in model for organizational reference |
|
The organization of the credentials exists in. |
|
The number of jobs to slice into at runtime, if job template prompts for job slices. Will cause the Job Template to launch a workflow if value is greater than 1. Default: |
|
Job tags applied as a prompt, if job template prompts for job tags |
|
Job type applied as a prompt, if job template prompts for job type Choices:
|
|
Limit to act on, applied as a prompt, if job template prompts for limit |
|
Related items to this workflow node. |
|
Nodes that will run after this node completes. List of node identifiers. |
|
Identifier of Node that will run after this node completes given this option. |
|
Credentials to be applied to job as launch-time prompts. List of credential names. Uniqueness is not handled rigorously. |
|
Name Credentials to be applied to job as launch-time prompts. |
|
Name of key for use in model for organizational reference |
|
The organization of the credentials exists in. |
|
Nodes that will run after this node on failure. List of node identifiers. |
|
Identifier of Node that will run after this node completes given this option. |
|
Instance groups to be applied to job as launch-time prompts. List of Instance group names. Uniqueness is not handled rigorously. |
|
Name of Instance groups to be applied to job as launch-time prompts. |
|
Labels to be applied to job as launch-time prompts. List of Label names. Uniqueness is not handled rigorously. |
|
Name Labels to be applied to job as launch-time prompts. |
|
Name of key for use in model for organizational reference |
|
The organization of the label node exists in. |
|
Nodes that will run after this node on success. List of node identifiers. |
|
Identifier of Node that will run after this node completes given this option. |
|
SCM branch applied as a prompt, if job template prompts for SCM branch |
|
Tags to skip, applied as a prompt, if job tempalte prompts for job tags |
|
Desired state of the resource. Choices:
|
|
Maximum time in seconds to wait for a job to finish (server-side), if job template prompts for timeout. |
|
Name of unified job template to run in the workflow. Can be a job template, project sync, inventory source sync, etc. Omit if creating an approval node (not yet implemented). |
|
Optional description of this workflow approval template. |
|
Name of key for use in model for organizational reference Only Valid and used if referencing an inventory sync This parameter is mutually exclusive with suboption |
|
Name of key for use in model for organizational reference |
|
The organization of the inventory the node exists in. Used for looking up the job template or project, not a direct model field. |
|
Name of unified job template to run in the workflow. Can be a job template, project, inventory source, etc. |
|
Name of key for use in model for organizational reference Only Valid and used if referencing a job template or project sync This parameter is mutually exclusive with suboption |
|
The organization of the job template or project sync the node exists in. Used for looking up the job template or project sync, not a direct model field. |
|
The amount of time (in seconds) to wait before Approval is canceled. A value of 0 means no timeout. Only Valid and used if referencing an Approval Node Default: |
|
Name of unified job template type to run in the workflow. Can be a job_template, project, inventory_source, system_job_template, workflow_approval, workflow_job_template. |
|
Verbosity applied as a prompt, if job template prompts for verbosity 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: Create a workflow job template
workflow_job_template:
name: example-workflow
description: created by Ansible Playbook
organization: Default
- name: Create a workflow job template with workflow nodes in template
awx.awx.workflow_job_template:
name: example-workflow
inventory: Demo Inventory
extra_vars: {'foo': 'bar', 'another-foo': {'barz': 'bar2'}}
workflow_nodes:
- identifier: node101
unified_job_template:
name: example-project
inventory:
organization:
name: Default
type: inventory_source
related:
success_nodes: []
failure_nodes:
- identifier: node201
always_nodes: []
credentials:
- local_cred
- suplementary cred
- identifier: node201
unified_job_template:
organization:
name: Default
name: job template 1
type: job_template
credentials: []
related:
success_nodes:
- identifier: node301
failure_nodes: []
always_nodes: []
credentials: []
- identifier: node202
unified_job_template:
organization:
name: Default
name: example-project
type: project
related:
success_nodes: []
failure_nodes: []
always_nodes: []
credentials: []
- identifier: node301
all_parents_must_converge: false
unified_job_template:
organization:
name: Default
name: job template 2
type: job_template
related:
success_nodes: []
failure_nodes: []
always_nodes: []
credentials: []
register: result
- name: Copy a workflow job template
workflow_job_template:
name: copy-workflow
copy_from: example-workflow
organization: Foo
- name: Create a workflow job template with workflow nodes in template
awx.awx.workflow_job_template:
name: example-workflow
inventory: Demo Inventory
extra_vars: {'foo': 'bar', 'another-foo': {'barz': 'bar2'}}
workflow_nodes:
- identifier: node101
unified_job_template:
name: example-inventory
inventory:
organization:
name: Default
type: inventory_source
related:
failure_nodes:
- identifier: node201
- identifier: node102
unified_job_template:
organization:
name: Default
name: example-project
type: project
related:
success_nodes:
- identifier: node201
- identifier: node201
unified_job_template:
organization:
name: Default
name: example-job template
type: job_template
inventory:
name: Demo Inventory
organization:
name: Default
related:
success_nodes:
- identifier: node401
failure_nodes:
- identifier: node301
always_nodes: []
credentials:
- name: cyberark
organization:
name: Default
instance_groups:
- name: SunCavanaugh Cloud
labels:
- name: Custom Label
organization:
name: Default
- all_parents_must_converge: false
identifier: node301
unified_job_template:
description: Approval node for example
timeout: 900
type: workflow_approval
name: Approval Node for Demo
related:
success_nodes:
- identifier: node401
- identifier: node401
unified_job_template:
name: Cleanup Activity Stream
type: system_job_template