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:
- Log into the Ansible Automation Platform and navigate to Projects in the left pane.
- On the projects page, click Add.
- In the Create New Project page:
- Enter a name for the project
- Optionally give it a description
- For Execution Environment, in most cases you can use Default execution environment
- For Source Control URL, use the HTTPS url for your GitLab repository
- For Source Control Credential, use the credential you created for GitLab
- 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)
- 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:
- Log into the Ansible Automation Platform and navigate to Templates in the left pane.
- On the templates page, click Add > Add job template.
- In the new job template page:
- Enter a name for the job.
- Optionally enter a description.
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.
- For project, choose a Project that has the ansible playbook you wish to run.
- For Execution Environment, in most cases you can use Default execution environment.
- For playbook, choose is the file that contains your Ansible playbook.
- Optionally, define any credentials and variables needed for the job execution.
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.
- Optionally, define any job tags.
- Optionally, enable priviledge escaltion if your job needs administrator privileges.
- 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:
- Log into the Ansible Automation Platform and navigate to Templates in the left pane.
- 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.