-
Enable Privilege Escalation
This exercise will walk you through the steps required to create a job template and run it. A job template is a definition and set of parameters for running an Ansible job. In other words, a template combines an Ansible project playbook and the settings required to launch it, into one package.
Templates save setup time, for jobs that are launched repetitively. Once the template is set, it can be edited for future jobs, with different settings. Templates also drive uniformity, by running templates exactly the same way every time. And, because we’re using templates, production responsibilities can be delegated to less experienced production personnel.
Select TEMPLATES
Click and select JOB TEMPLATE
Complete the template form, by entering the following values:
NAME |
Apache Basic Job Template |
DESCRIPTION |
Template for the apache-basic-playbook |
JOB TYPE |
Run |
INVENTORY |
Ansible Workshop Inventory |
PROJECT |
Ansible Workshop Project |
PLAYBOOK |
examples/apache-basic-playbook/site.yml |
MACHINE CREDENTIAL |
Workshop Credentials |
LIMIT |
web |
VERBOSITY |
0(Normal) |
OPTIONS |
|
Click SAVE and then select ADD SURVEY
Job surveys provide extra playbook variables and present them in a user-friendly way. They also enable validation of the input you provide.
Complete the survey form with following values.
PROMPT |
Please enter a test message for your new website |
DESCRIPTION |
Website test message prompt |
ANSWER VARIABLE NAME |
apache_test_message |
ANSWER TYPE |
Text |
MINIMUM/MAXIMUM LENGTH |
Use the defaults |
DEFAULT ANSWER |
Be creative, keep it clean, we’re all professionals here |
Select +ADD
Select SAVE
Back on the main Job Template page, select SAVE again.
Now that you’ve sucessfully created your Job Template, you are ready to launch it. You will be redirected to a job screen, which refreshes in realtime and displays the status of the job.
Select TEMPLATES
Alternatively, if you haven’t navigated away from the job templates creation page, you can scroll down to see all existing job templates |
Click the rocketship icon for the Apache Basic Job Template
When prompted, enter your desired test message
Select LAUNCH
Sit back, watch the magic happen
One of the first things you will notice is the RESULTS section. This section provides job details, such as who launched it, what playbook it’s running, what the status is, i.e. Pending, Running, or Complete.
To the right, you can view standard output; the same way you could if you were running Ansible Core from the command line.
Once your job is sucessful, navigate to your new website, where workshopname is the name of your workshop, and # is your student number:
http://example.node.0.redhatgov.io
If all went well, you should see something like this, but with your own custom message:
At this point in the workshop, you’ve experienced the core functionality of Ansible Tower. But wait… there’s more! You’ve just begun to explore the possibilities of Ansible Core and Tower. Take a look at the resources page in this guide, to explore some more features.
Domain | ||
Workshop | ||
Student ID |