Workshop Exercise 2.5 - Running Our Playbook through Controller

Table of Contents

Objective

In this exercise, we’ll sync our project in Ansible Controller, create a job template, and run our new playbook.

Step 1 - Syncing Our Project

Return to the Ansible Controller WebUI and navigate to Resources > Projects. Locate the project named Device Edge Codebase and click the Sync Project button on the right hand side of the page.

For reference, this is the sync button: Sync Button

After clicking the sync button, the WebUI will show the project syncing and then a success under the Status column.

Step 2 - Creating a Job Template

Note

Be sure to sync your project in Controller before attempting to create this job template.

In the Controller WebUI. under Resources > Templates, select Add > Add job template and enter the following information:

Parameter Value
Name Compose Image
Inventory Edge Utilites
Project Device Edge Codebase
Execution Environment Device Edge Workshops Execution Environment
Playbook playbooks/compose-image.yml
Credentials
  • ✓ Image Builder Credentials
  • Options
  • ✓ Privilege Escalation
  • Remember to click Save.

    Step 3 - Running the Job Template

    Now that the job template has been created, click the Launch button if you are still within the Compose Image job template. Otherwise, click on the rocket ship on the Templates page to launch the job template. Monitor the output for any errors or issues. However, hopefully the job executes successfully.

    As a reminder, the output of jobs can be reviewed on the Jobs tab. Because we’re composing an image, this job will take some time to complete, however the images we’re using for this workshop have already been built and deployed.

    To confirm your image compose is queued/running, log in to the Image Builder WebUI. For a quick refresher, review the Image Builder Introduction.

    Additional Information

    The best practice here would be to wrap this job template into a workflow, and then have some CI/CD tooling leverate Ansible Controller over the API to automatically build new images and run some tests as the image definition file changes via git updates.

    This is a fairly large topic, but Controller is flexible and API driven, so integration with new or existing tooling is straightforward, and allows for best practices.

    Note

    To speed up the workshop, your instructor has already composed this image for you, so there’s no need to wait for the job to finish.

    Solutions

    Compose Image Job Template


    Navigation

    Previous Exercise Next Exercise

    Click here to return to the Workshop Homepage