Use Cases of Ansible AWX

Ratnangi Nirek
May 19, 2021
February 28, 2020

In our last post, we gave an overview of what Ansible AWX is and how it can be used in automating IT infrastructure. Now, we wanted to share some use cases of Ansible AWX.

1.    Integrating AWX with Gitlab:

AWX gives a provision of holding multiple playbooks by creating a project and storing playbooks with the help of SCM (Source Code Management) such as SCMs including; GitLab, GitHub, Subversion, etc. The projects are under the directory /var/lib/awx/projects on the Ansible AWX server.

Ansible AWX and GitLab make lives easier by building out CI/CD workflows. As we know, the continuous integration pipeline will help in securing the master branch so that once the build starts, it succeeds. This methodology is achieved only by creating new feature branch and performing the appropriate tests, and then merging it to the master.

The CI pipeline goes something like this:

Development  QA  UAT  Production

Ansible AWX provides a webhook which can help in triggering the latest release once the master branch is updated.

Job Templates:

The Ansible playbooks are termed as job templates in AWX. The templates can be used for either provisioning the virtual machines if coming from systems administration or for performing CI/CD tests, or to perform cleanups.

2.    Perform Linux patching via Spacewalk and AWX:

Patching servers has become an important task in corporate world: for both IT organizations and business offices.

With the increase in demand to provide best services to our customers, it is important to automate the tasks of performing security patches and maintaining the Linux servers.

Spacewalk helps in finding out the security holes left by an outdated software or poorly written applications, by checking if there is any package update.

Without automation, this requires a lot of human labor which would include maintaining the inventory list and making sure the servers are patched and software is updated and running with the updated kernel. Spacewalk provides an open source solution to maintain the Linux servers, as well as updating the servers and installing and updating software on systems.

By integrating Spacewalk with AWX, as soon as a new server is added to the inventory, the workflow templates shown below will be executed - which will register the servers to Spacewalk and hereby patch the servers as well for any security updates required.

This way, by connecting the Spacewalk plugin with the AWX, the playbooks can be scheduled accordingly to the hosts which have been registered to the Spacewalk server for applying security patches without any human intervention.

3.    API usage of Ansible AWX:

Ansible AWX provides an efficient way to perform REST API calls in order to connect, generate results and get template information. Without accessing the AWX UI, you can successfully launch job templates and get the desired results. The Restful API can be used anywhere and will act as web portal within itself.

Format of using AWX API:  http://{AWX_UI}/api/v2

There are multiple plugins and modules through which Ansible AWX can be integrated with different CI/CD DevOps tools. This will help in automating job scheduling, inventory management, reporting, workflow automation and credential sharing, thus helping in faster application deployment.

Ansible AWX provides an open source framework for handling automation of Ansible applications, provisioning and managing servers with the help of web UI and RESTFUL API. It has also become a necessity to create, destroy and replace servers at any time without causing service disruptions.

Automating with AWX will help in scaling and making technology adjustments on time thus reducing human error. This will help in providing faster end-to-end solution from development to production to the customers, thus increasing workforce productivity.

Set yourself up for success.

See how ACTIVE can help your organization grow.
More from the blog
View all
Never miss a minute.
Learn about best practices, community stories, product updates, and more.
We will never share your email address with third parties.