Server Management

Import an Ansible playbook into the Ansible Automation Platform

Last modified 3/13/2023

To run Ansible playbooks in the Ansible Automation Platform (AAP), you must first create a Project and a Job Template in AAP.

Before you Begin

Ansible playbooks that you want to use and import should be in git repositories in GitLab. Refer to Create Credentials for GitLab to use in the Ansible Automation Platform to setup GitLab credientials in AAP.

Create a Project

Projects in the Ansible Automation Platform is a where Ansible playbooks get imported and pulled for use in Job Templates.

To create a new project:

  1. Log into the Ansible Automation Platform and navigate to Projects in the left pane.
  2. On the projects page, click Add.
  3. In the Create New Project page:
    1. Enter a name for the project
    2. Optionally give it a description
    3. For Execution Environment, in most cases you can use Default execution environment
    4. For Source Control URL, use the HTTPS url for your GitLab repository
    5. For Source Control Credential, use the credential you created for GitLab
    6. Optionally there are branching options and other options at the bottom. Refer to the Projects section in the AAP product documentation. (Link at bottom of page)
  4. Click Save.

Create a Job Template

A Job Template in the Ansible Automation Platform is a preconfigured set of parameters that define how to run an Ansible playbook. It allows users to define parameters such as the target inventory, the playbook to execute, and the credentials to use for authentication, and other options.

To create a new job template:

  1. Log into the Ansible Automation Platform and navigate to Templates in the left pane.
  2. On the templates page, click Add > Add job template.
  3. In the new job template page:
    1. Enter a name for the job.
    2. Optionally enter a description.
    3. Choose the inventory that you want to run the playbook against. 

      Prompt on Launch Options

      A lot of the Job Template options have a Prompt on Launch option which will allow for user input before job execution.

    4. For project, choose a Project that has the ansible playbook you wish to run.
    5. For Execution Environment, in most cases you can use Default execution environment.
    6. For playbook, choose is the file that contains your Ansible playbook.
    7. Optionally, define any credentials and variables needed for the job execution.
    8. Optionally, define a limit which can be an inventory group or hostname.

      Inventory Limits

      If you are using your All Systems inventory for your team, not setting a limit will make the job execution run on all hosts.

    9. Optionally, define any job tags.
    10. Optionally, enable priviledge escaltion if your job needs administrator privileges.
    11. There are other options available and more information can be found in AAP docs, here.

Run a Job Template

To execute a job template to run:

  1. Log into the Ansible Automation Platform and navigate to Templates in the left pane.
  2. You can either click the rocket icon on the right side of the Job Template name, or if you select a template there is an option for Launch in the Job Template details screen

Still Need Assistance?

If you need help with the Ansible Automation Platform, please reach out to the Tech Solutions Cloud Compute & Authentication team.

See Also: