Exercise 6: Creating a Tower Job Template

Read this in other languages: uk English, japan 日本語.

Table of Contents

Objective

Demonstrate a network backup configuration job template for Red Hat Ansible Tower. This job template will save the running configuration from all four routers and store them under /backup on the control node with a timestamp.

To run an Ansible Playbook in Ansible Tower we need to create a Job Template. A Job Template requires:

Guide

Step 1: Create a Job Template

Make sure to select Job Template and not Workflow Template)

Here is a walkthrough:

animation walkthrough ansible tower Prefer Youtube? Click Here

Step 2: Launch the Job Template

  1. Navigate back to the Templates window, where all Job Templates are listed.

  2. Launch the Backup network configurations Job Template by clicking the Rocket button.

    rocket button

    When the rocket button is clicked this will launch the job. The job will open in a new window called the Job Details View. More info about Tower Jobs can be found in the documentation.

Step 3: Examine the Job Details View

On the left side there is a Details pane on the right side there is the Standard Out pane.

job details view

  1. Examine the Details pane

    The Details pane will information such as the timestamp for when the job started and finished, the job type (Check or Run), the user that launched the job, which Project and Ansible Playbook were used and more.

    If the Job has not finished yet, the Details Pane will have a cancel button cancel button that can be used to stop the Job.

  2. Examine the Standard Out pane

    The Standard Out pane will display the output from the Ansible Playbook. Every task output will match exactly what would be seen on the command line.

  3. Click on the Expand Output button expand image

    This will expand the Standard Out pane to take the entirety of the window.

  4. Click on a task in the Standard Out pane to open up structured output from that particular task.

    Click on any line where there is a changed or ok

    task details window

Step 4: Examine the Jobs window

Any Job Template that has been run or is currently running will show up under the Jobs window.

  1. Click the Jobs button the left menu.

    jobs button

    The Jobs link displays a list of jobs and their status–shown as completed successfully or failed, or as an active (running) job. Actions you can take from this screen include viewing the details and standard output of a particular job, relaunch jobs, or remove jobs.

  2. Click on the Backup network configurations Job

    jobs link

    The Backup network configurations job was the most recent (unless you have been launching more jobs). Click on this job to return to the Job Details View. Ansible Tower will save the history of every job launched.

Step 5: Verify the backups were created

Takeaways

You have successfully demonstrated

Complete

You have completed lab exercise 6


Click here to return to the Ansible Network Automation Workshop