Ansible is an automation tool that comes under IAAC (infrastructure as a code). Ansible is used for provisioning the infrastructure of the working environment, and virtualized hosts. It can also be used to install services and provision resources inside the cloud infrastructure. Ansible AWX is a freely available project tool for testing, which can be used in the lab, POC environment or deployment. It is considered the foundation on which the Ansible Tower was created. Also, AWX is a code branch that only goes through minimal and quality engineering testing. Basically, AWX is a solution that makes possible Ansible to be more comfortable to use. The basic idea of AWX is to be the hub for all automation tasks.
Ansible goes forward to improve the lifecycle of the Ansible AWX product so that it is in a tighter lockout stage with the Ansible tower versions. A major advantage of AWX over Ansible Tower is that the user will have all enterprise functionality nodes.
When AWX can be classified as a tool in the “Server Configuration and Automation” Tower is grouped under “Source Code Management Desktop Apps”. Now, let’s check out how to set up Credentials, Inventories, Projects, and Job Templates on AWX.
- Setup Credentials
Begin by setting up the Ansible AWX Credential that is used for authentication when launching and executing tasks on servers, syncing hosts files or inventory. Ansible AWX supports many credentials, including the VM machine through SSH authentication, AWS, Google Compute Engine, OpenStack, Vault password, Source Control, etc. In default.
For this, click the “Credentials” on the left and then the “+” button on the right side.
Now enter credentials “NAME” and “DESCRIPTION”, then specify the “CREDENTIAL TYPE” to ‘Machine’.
Simply, the “Machine” credential will allow the user to do SSH authentication for managing instances. It will support key-based authentications as well as passwords.
Click the ‘SAVE’ button then.
- Setting Inventories
The Inventories are groups of servers managed by Ansible AWX. In hosts, it is possible to create a group with several client servers.
By creating groups it is getting easier to manage different servers with different environments.
In order to manage servers, we need to create a new inventory group and then add server hosts in it.
To add Inventories, click the ‘Inventories’ menu on the left, then click the ‘+’ button and choose ‘Inventory’.
Type the ‘NAME’ and “DESCRIPTION” of the inventory, and then click the ‘SAVE’ button.
Now click on the “HOSTS”, and click the “+” button to add new hosts.
Type the ‘HOST NAME’, “DESCRIPTION”, and the “VARIABLES” with additional configuration for the target machine IP address.
Click the ‘SAVE’ button.
Then we need to ensure host configuration by checking the hosts by doing a ping.
Go Back to the “HOSTS” tab, tick your host’s name server and click the “RUN COMMANDS” button.
Now choose the “MODULE” called “ping”, click the search button inside the “MACHINE CREDENTIAL” and “SELECT” your own, then click the “LAUNCH” button.
Now a new inventory will be created and the target machine server has been added to it.
- Setup Projects
In AWX, Projects are represented as Ansible Playbooks. These are basically Ansible Playbooks collections that we can manage through our local project directory. For creating new projects, click the “Projects” menu on the left and click the “+” button.
Provide the ‘NAME’ of the project that we are adding, and the ‘DESCRIPTION’, then choose the “SCM TYPE” to ‘Git’ and paste your playbook repo. Then click the ‘SAVE’ button. A new project for the playbook will be created.
- Setting Job Templates
To create or run the job template, the user needs to add the Ansible playbook from our “Project”, and the client machines that are stored on the “Inventories”.
Click the ‘Templates’ menu on the left, then click the “+” button and choose the ‘Job template’ option from there.
Now you need to type the “NAME” and “DESCRIPTION” of the job that we are going to add. Then choose the “INVENTORY”, “CREDENTIAL”, and the “PROJECT”. Then specify the “PLAYBOOK”
That needed to run and deploy. A new job template Ansible AWX will be created.
In the blog, we discussed on the Ansible AWX and some of its features. The goal is to get you started on using AWX it is cheap and easy to do.
If you require help, contact SupportPRO Server Admin