diff --git a/decks/images/ComplicatedWorkflow.jpg b/decks/images/ComplicatedWorkflow.jpg new file mode 100644 index 00000000..a2aec249 Binary files /dev/null and b/decks/images/ComplicatedWorkflow.jpg differ diff --git a/decks/images/SimpleWorkflow.jpg b/decks/images/SimpleWorkflow.jpg new file mode 100644 index 00000000..59e012b0 Binary files /dev/null and b/decks/images/SimpleWorkflow.jpg differ diff --git a/decks/images/copy_workflows.jpg b/decks/images/copy_workflows.jpg new file mode 100644 index 00000000..d498651e Binary files /dev/null and b/decks/images/copy_workflows.jpg differ diff --git a/decks/images/creating_workflow1.jpg b/decks/images/creating_workflow1.jpg new file mode 100644 index 00000000..657b4fbd Binary files /dev/null and b/decks/images/creating_workflow1.jpg differ diff --git a/decks/images/creating_workflow2.jpg b/decks/images/creating_workflow2.jpg new file mode 100644 index 00000000..61e94d29 Binary files /dev/null and b/decks/images/creating_workflow2.jpg differ diff --git a/decks/images/creating_workflow3.jpg b/decks/images/creating_workflow3.jpg new file mode 100644 index 00000000..65a5df37 Binary files /dev/null and b/decks/images/creating_workflow3.jpg differ diff --git a/decks/images/creating_workflow4.jpg b/decks/images/creating_workflow4.jpg new file mode 100644 index 00000000..92cc66ab Binary files /dev/null and b/decks/images/creating_workflow4.jpg differ diff --git a/decks/images/creating_workflow5.jpg b/decks/images/creating_workflow5.jpg new file mode 100644 index 00000000..0dfef382 Binary files /dev/null and b/decks/images/creating_workflow5.jpg differ diff --git a/decks/images/example_template.png b/decks/images/example_template.png new file mode 100644 index 00000000..96bdf98c Binary files /dev/null and b/decks/images/example_template.png differ diff --git a/decks/images/fifth_row.png b/decks/images/fifth_row.png new file mode 100644 index 00000000..1f1b0d31 Binary files /dev/null and b/decks/images/fifth_row.png differ diff --git a/decks/images/first_one.png b/decks/images/first_one.png new file mode 100644 index 00000000..ae7f9a79 Binary files /dev/null and b/decks/images/first_one.png differ diff --git a/decks/images/first_row.png b/decks/images/first_row.png new file mode 100644 index 00000000..2eded83d Binary files /dev/null and b/decks/images/first_row.png differ diff --git a/decks/images/fourth_row.png b/decks/images/fourth_row.png new file mode 100644 index 00000000..266c60ac Binary files /dev/null and b/decks/images/fourth_row.png differ diff --git a/decks/images/other_options.png b/decks/images/other_options.png new file mode 100644 index 00000000..5f6e4861 Binary files /dev/null and b/decks/images/other_options.png differ diff --git a/decks/images/schedule_workflows1.jpg b/decks/images/schedule_workflows1.jpg new file mode 100644 index 00000000..d8f10130 Binary files /dev/null and b/decks/images/schedule_workflows1.jpg differ diff --git a/decks/images/schedule_workflows2.jpg b/decks/images/schedule_workflows2.jpg new file mode 100644 index 00000000..e8491c45 Binary files /dev/null and b/decks/images/schedule_workflows2.jpg differ diff --git a/decks/images/second_row.png b/decks/images/second_row.png new file mode 100644 index 00000000..3d5428aa Binary files /dev/null and b/decks/images/second_row.png differ diff --git a/decks/images/third_row.png b/decks/images/third_row.png new file mode 100644 index 00000000..af3d4c46 Binary files /dev/null and b/decks/images/third_row.png differ diff --git a/decks/images/workflow_notification1.jpg b/decks/images/workflow_notification1.jpg new file mode 100644 index 00000000..7190ff39 Binary files /dev/null and b/decks/images/workflow_notification1.jpg differ diff --git a/decks/images/workflow_notification2.jpg b/decks/images/workflow_notification2.jpg new file mode 100644 index 00000000..cff5ab59 Binary files /dev/null and b/decks/images/workflow_notification2.jpg differ diff --git a/decks/images/workflow_survey1.jpg b/decks/images/workflow_survey1.jpg new file mode 100644 index 00000000..dde5eb12 Binary files /dev/null and b/decks/images/workflow_survey1.jpg differ diff --git a/decks/images/workflow_survey2.jpg b/decks/images/workflow_survey2.jpg new file mode 100644 index 00000000..62565f69 Binary files /dev/null and b/decks/images/workflow_survey2.jpg differ diff --git a/decks/workflowjobtemplates.html b/decks/workflowjobtemplates.html new file mode 100644 index 00000000..ac92dd47 --- /dev/null +++ b/decks/workflowjobtemplates.html @@ -0,0 +1,405 @@ + + + + + + + Job Templates and Workflows in Ansible + + + + + + + + + + + + + + + + +
+ + + + + + +
+
+
+
+ +

Job Templates and Workflows in Ansible Tower

+

NAME HERE, TITLE HERE

+

COMPANY HERE

+
+ +
+

General Ansible Tower Setup

+ You will need:

+
    +
  • Inventory
  • +
  • A project to select a playbook from
  • +
  • Up-to-date credentials
  • +
+ +
+ +
+

What is a Job Template?

+
    +
  • A definition and set of parameters for running an Ansible playbook
  • +
  • In Ansible Tower, they are a visual realization of the ansible-playbook command and all flags you can utilize when executing from the command line
  • +
  • It defines the combination of a playbook from a project, an inventory, a credential and any other Ansible parameters required to run
  • +
+ +
+ +
+

Before You Start

+

Whether you're invoking an inventory file or setting tags, you will + be adding arguments as part of the job template +

It's recommended to know, before you start:

+
    +
  • How to connect to the machine (credentials)
  • +
  • What you want to change on the machine (project/playbook)
  • +
+ +
+ +
+

Creating a Job Template

+
    +
  • Select Templates from the top of the screen:
  • +

    +
  • Navigate to the "Add" drop-down box and select Job Template
  • +
+ +
+ +
+

Naming and Job Type

+

+
    +
  • Name the job template anything you like
  • +
  • Descriptions are optional
  • +
  • Select either "Check" or "Run" for Job Type:
  • + Check performs a “dry run” of the playbook
    + Run will execute the tasks in the playbook on the selected hosts +
+ +
+ +
+

Inventory, Project, and Playbook Selection

+

+
    +
  • There is a “prompt on launch” option for the Inventory selection; users can alternatively invoke a more complex selection prompt at the beginning of a job using a Survey
  • +
  • The Project option determines which playbooks can be selected
  • +
  • Tower will not display the full file name of playbooks (e.g., AWS.yml will display as AWS)
  • +
+ +
+ +
+

Credentials, Forks, Limits

+

+
    +
  • Choose the credential from the available options to be used with this job template
  • +
  • Forks are the number of parallel or simultaneous processes to use while executing the playbook; a value of zero uses the Ansible default setting, which is five parallel processes unless overridden in /etc/ansible/ansible.cfg
  • +
  • The Limit option provides a host pattern to further constrain the list of hosts that will be managed or affected by the playbook; multiple patterns are allowed
  • + +
+ +
+

Verbosity, Instance Groups, Job Tags

+

+
    +
  • Verbosity controls the level of output Ansible will produce as the playbook executes
  • +
  • Users can optionally select which Instance Groups the job template will run on
  • +
  • Job tags are useful when you have a large playbook and want to run a specific part of a play or task; this option provides a comma-separated list of playbook tags to specify what parts of the playbooks should be executed
  • +
+ +
+ +
+

Skip Tags, Labels, Show Changes

+

+
    +
  • Skip Tags is a useful option when you have a large playbook and want to skip specific parts of a play or task
  • +
  • Labels are optional and can be used to describe the job template, i.e., "test" or "dev"
  • +
  • When Show Changes is on, users can see changes made by Ansible tasks
  • +
+ +
+ +
+

Other Options

+

+
    +
  • Enable Privilege Escalation: Enable this to run the playbook as an administrator
  • +
  • Allow Provisioning Callbacks: Enables a host to call back to Tower via the Tower API and launch a job from this job template
  • +
  • Enable Concurrent Jobs: Allows simultaneous runs of this particular job template
  • +
  • Use Fact Cache: When enabled, this activates an Ansible fact cache plugin for all hosts in an inventory related to the job running
  • +
+ +
+ +
+

Job Template Example

+

+ +
+ +
+
+

Job Template Demo Time:
[Could show job templates in Tower (optional)]

+ +
+
+

See how it works?
You can put sections inside of sections. (to remove the red just remove the data state)

+ +
+
+ +
+

What is a Workflow?

+
    +
  • Available as of Ansible Tower version 3.1
  • +
  • Enables users to create sequences consisting of any combination of job templates, project syncs, and inventory syncs that are linked together in a single unit
  • +
  • Helps to organize playbooks and job templates into separate groups
  • +
+ +
+ +
+

What Makes Workflows Useful?

+
    +
  • Can set up ordered structures for different teams to use
  • +
  • Not everyone involved will need to know what job run goes after what, since the structure is set up for them by the user who created the workflow
  • +
  • Connects disparate job types and unifies projects without each team needing to know everything about what the other does
  • +
  • They allow the user to take any number of playbooks and “daisy chain” them
  • +
  • Provides the ability to make a decision tree depending on a job’s success or failure
  • +
+ +
+ +
+

Creating a Workflow

+

Go into the Templates section on the top menu of Ansible Tower:

+

+ +
+ +
+

Creating a Workflow (continued)

+

From there, click on “Add”, but make sure to select “Workflow Template”:

+

+ +
+ +
+

Creating a Workflow (continued)

+

On this screen, name your workflow template anything you like and save it:

+

+ +
+ +
+

Creating a Workflow (continued)

+

Go into “Workflow Editor”:

+

+ +
+ +
+

Creating a Workflow (continued)

+

Job templates can be added on this screen; users can select set them to run on failure, success, or with either outcome:

+

+ +
+ +
+

Example Workflow

+

You can make them as simple...

+

+ +
+ +
+

Another Example Workflow

+

...or as complex as you need to!

+

+ +
+ +
+

Scheduling Workflows

+

Click on the calendar icon next to any workflow job template:

+

+ +
+ +
+

Scheduling Workflows (continued)

+

...and fill out the information for when you want the specified workflow to automatically run:

+

+ +
+ +
+

Duplicating Workflows

+

To make a copy of an existing workflow, click on the button highlighted below:

+

+ +
+ +
+

Surveys

+

Select a workflow template and click on the “Add Survey” button:

+

+ +
+ +
+

Surveys (continued)

+

A survey screen that you can fill out with specific questions and answer types will show up:

+

+ +
+ +
+

Notifications

+

Select the workflow that you want to set notifications for, then click the Notifications button:

+

+ +
+ +
+

Notifications (continued)

+

The screen that comes up will enable you to select specific notifications; in the example below the “Workflow-Specific Notification” has been set to activate on either a successful or failed run:

+

+ +
+ +
+
+

Workflow Demo Time:
[Could show workflows in Tower (optional)]

+ +
+
+

See how it works?
You can put sections inside of sections. (to remove the red just remove the data state)

+ +
+
+ +
+

For More Information

+

Official Ansible Documentation:

+ Job Templates
+ https://docs.ansible.com/ansible-tower/latest/html/userguide/job_templates.html

+ Workflows
+ https://docs.ansible.com/ansible-tower/latest/html/userguide/workflow_templates.html
+

+
+
+
+ + + + + + + diff --git a/index.html b/index.html index 5ac25ca1..cbdab920 100644 --- a/index.html +++ b/index.html @@ -53,7 +53,12 @@

Training Decks

Ansible Basics - +
+
+
+ Ansible Tower Workflows & Job Templates +
+