AWS Global Infrastructure

DevOps

Topics Covered
  • DevOps (74 Blogs)
  • Mastering Git and GitHub (3 Blogs)
  • Docker (9 Blogs)
  • DevOps Engineer Masters Program (18 Blogs)
SEE MORE

Exploring Ansible Tower With A Hands-On

Last updated on Dec 15,2021 20K Views

7 / 8 Blog from Ansible

Today’s scaling industries aim to provide large productivity gains, but they have to deal with a wide variety of automation challenges, which are overcome by tools such as Ansible. This blog on Ansible Tower will give you a complete insight into the following:

Alright!! So, let’s get started with what is Ansible Tower.

What is Ansible Tower?

Ansible Tower is Ansible at a more enterprise level. It is a web-based solution for managing your organization with a very easy user interface that provides a dashboard with all of the state summaries of all the hosts, allows quick deployments, and monitors all configurations.

The tower allows you to share the SSH credentials without exposing them, logs all the jobs, manage inventories graphically and syncs them with a wide variety of cloud providers.

Prerequisites To Install Ansible Tower

The following are the pre-requisites to install Tower:

Ansible Tower is supported by the following operating systems:

  • Red Hat Enterprise Linux 6 64-bit
  • Red Hat Enterprise Linux 7 64-bit
  • CentOS 6 64-bit
  • CentOS 7 64-bit
  • Ubuntu 12.04 LTS 64-bit
  • Ubuntu 14.04 LTS 64-bit
  • Ubuntu 16.04 LTS 64 bit

You should have the latest stable release of Ansible.

64-bit support required (kernel and runtime) and 20 GB hard disk.

Minimum 2 GB RAM (4+ GB RAM recommended) is required.

  • 2 GB RAM (minimum and recommended for Vagrant trial installations
  • 4 GB RAM is recommended /100 forks

For Amazon EC2: Instance size of m3.medium or larger is required for less than 100 hosts and if you have more than 100 hosts, then you require an instance size of m3.xlarge or larger.

For HA MongoDB setups, you can use the below formula for a rough estimate of the amount of space required.

(NumberOfHostsIninventory)*(NumberOfScans)*(AverageModuleFactSize)*(NumberOfModulesScanning)

Subscribe to our youtube channel to get new updates..!

Ansible Tower Parameters

In this section of the blog, you will get an insight into the following parameters of the tower:

Tower Editions

The Ansible Tower has 3 different editions; the self-support, standard, and the premium edition. Each of these editions varies with the capabilities they offer. You can do everything from application deployment to multi-tiered orchestrations, with control, security and logging capabilities.

SELF – SUPPORTSTANDARDPREMIUM
Ansible Tower DashboardYesYesYes
Real-Time Job OutputsYesYesYes
Remote Command ExecutionYesYesYes
Job SchedulingYesYesYes
Visual Inventory ManagementYesYesYes
WorkflowsNoYesYes
Built-In NotificationsYesYesYes
Role-Based Access ControlYesYesYes
Integration With Enterprise AccountsNoYesYes
Audit TrailNoYesYes
Logging and Analytics IntegrationNoYesYes
Installation SupportNoYesYes
24*7 SupportNoNoYes
Maintenance and UpgradesYesYesYes
Documented API &  Tower CLIYesYesYes
Scale-Out ClusteringNoYesYes

Tower Pricing

As I mentioned before the tower has 3 editions, out of which the self-support one is the free trial version. For the other two edition’s pricing, you can refer to the below table:

Ansible Tower Pricing - Ansible Tower - Edureka

Interested In Learning More About DevOps Tools?

Tower Features

Below are few of the Ansible Tower features:

Ansible Tower Features - Ansible Tower - Edureka

  • Ansible Tower Dashboard – The Ansible Tower dashboard displays everything going on in your Ansible environment like the hosts, inventory status, the recent job activity and so on.
  • Real-Time Job Updates – As Ansible can automate the complete infrastructure, you can see real-time job updates, like plays and tasks broken down by each machine either been successful or a failure. So, with this, you can see the status of your automation, and know what’s next in the queue. 
  • Multi-Playbook Workflows – This feature allows you to chain any number of playbooks, regardless of the usage of different inventories, utilizes various credentials, or runs different users.
  • Who Ran What Job When – As the name suggests, you can easily know who ran what job where and when as, all the automation activity is securely logged in Ansible Tower. 
  • Scale Capacity With Clusters –  We can connect multiple Ansible Tower nodes into an Ansible Tower cluster as the clusters add redundancy and capacity, which allow you to scale Ansible automation across the enterprise.
  • Integrated Notifications – This feature lets you notify a person or team when a job succeeds or fails across the entire organization at once, or customize on a per-job basis. 
  • Schedule Ansible Jobs – Different kinds of jobs such as Playbook runs, cloud inventory updates, and source control updates can be scheduled inside Ansible Tower to run according to the need.
  • Manage & Track Inventory – Ansible Tower helps you manage your entire infrastructure by letting you easily pull inventory from public cloud providers such as Amazon Web Services, Microsoft Azure, and more.
  • Self-Service – This feature of Ansible Tower lets you launch Playbooks with just a single click. It can also, let you choose from available secure credentials or prompt you for variables and monitor the resulting deployments.
  • REST API & Tower CLI Tool – Every feature present in Ansible Tower is available via Ansible Tower’s REST API, which provides the ideal API for a systems management infrastructure. The Ansible Tower’s CLI tool is available for launching jobs from CI systems such as Jenkins, or when you need to integrate with other command line tools.
  • Remote Command Execution – You can run simple tasks such as add users, restart any malfunctioning service, reset passwords on any host or group of hosts in the inventory with Ansible Tower’s remote command execution.

Alright!! So, now that you guys have understood the features of Ansible Tower, let’s get into the installation of Ansible Tower.

Installation of Ansible Tower

Before you install Ansible Tower, you have to first install and configure Ansible on your operating system and then also install PostgreSQL.

So, first let’s start by installing and configuring Ansible. I will be using Ubuntu – 16.04 version as my operating system.

Install and Configure Ansible on Ubuntu

Step 1: As a root user, configure the Ansible PPA using the below commands.

apt-get install software-properties-common
apt-add-repository ppa:ansible/ansible

Step 2: After configuring, install Ansible using the below commands.

apt-get update
apt-get install ansible

After you are done installing, install PostgreSQL.

Installing PostgreSQL

Use the below commands, to install PostgreSQL.

apt-get update
sudo apt-get install postgresql postgresql-contrib

Download Ansible Tower

Step 1.1: Once you are done installing Ansible, register to download the Ansible – Tower.

Step 1.2: You will receive an email after you register to download the Ansible Tower. Open your mail and then click on the download button, to download.

Ansible Tower Dashboard Download - Ansible Tower - Edureka

Step 1.3: Then extract the Ansible Tower installation tool using the below commands.

tar xvzf ansible-tower-setup-latest.tar.gz
ansible-tower-setup-<tower_version>

where tower-version, is the version of the tower you have downloaded.

Step 2: After that set up your inventory file, where you have to mention the necessary passwords (admin_password, pg_password, rabbitmq_password) in the inventory file.

Ansible Tower Inventory File - Ansible Tower - Edureka

Step 3: Now, as the Tower setup playbook script uses the inventory file, it has to be invoked as ./setup.sh from the path where you unpacked the Tower installer tarball.

./setup.sh

Step 4: Once you are done setting up the Tower, use the web browser to access the Tower server and view the Tower login screen, wherein you have to enter the username and password, to access the Tower Dashboard.

Ansible Tower Dashboard - Ansible Tower - Edureka


Want To Know More About DevOps?

Hands-On 

In this hands-on, I will show you how to create a job to print a message.

So, refer to the below diagram for the steps that we are going to follow.

Steps For HandsOn - Ansible Tower - Edureka

Create a User

To create a user, go the settings option and then choose the User tab. Once you enter the User tab, click on the Add option to add a new User. Mention the details required and then click on Save.

Snapshot Of Creating A User - Ansible Tower - Edureka

Create an Inventory

Now, create an Inventory, by just clicking on the Inventories option and then going to the Add option.

Snapshot Of Creating An Inventory - Ansible Tower - Edureka

Once you click on the Add option, mention all the details required like the name, description, organization and then click on Save.

Snapshot Of Creating An Inventory - Ansible Tower - EdurekaCreate a Host

To create a host, go the Inventories tab and choose the inventory to which you want to add hosts. Then choose the Hosts tab and click on Add Hosts. Here I want to add hosts for the inventory that was created above. Once the details are mentioned, click on Save.

Snapshot Of Creating Hosts - Ansible Tower - Edureka

Create a Credential

After creating hosts, create a credential by going to the settings options, and then choose the Credentials tab. After that, go to the Add option and mention the details. Once you are done, mentioning the details, click on Save.

Snapshot Of Creating Credentials - Ansible Tower - Edureka

Setting up a Project

There are two ways to access a simple playbook, either you can do it manually or by specifying a link from a Github repository.

In this blog, I am going to access the project manually.

Accessing a Manually created Playbook

For accessing a manually created playbook, you first have to create a playbook and then set up the project.

So, follow the below steps and start creating a playbook.

Use command line console as a root user and create a directory for your project on the Tower server file system, in which to store your Ansible playbooks for this project.

Snapshot Of Setting Up A Project Manually - Ansible Tower - Edureka

Now, make a new project directory by creating it on the Tower filesystem under the Project Base Path directory, located by default in “/var/lib/awx/projects/”. Here the new directory is DEMO.

Snapshot Of Setting Up A Project Manually - Ansible Tower - Edureka

Now, let’s start setting up a project.

To set up a project use your web browser, create the new project by clicking on the Projects link at the top of the Tower Dashboard and click on the Add button.

Snapshot Of Setting Up A Project Manually - Ansible Tower - Edureka

Once you click on the Add button, you will be redirected to a page wherein you have to fill in details such as Name and Description of Project. Then, set the SCM type to be Manual, and for the Playbook Directory, select a value which corresponds to the subdirectory you created and then click on Save.

Snapshot Of Setting Up A Project Manually - Ansible Tower - Edureka

Create a Job Template

Now, let’s create a Job Template, by going to the Job Template tab and then clicking on the Add button. Once you click on the Add button, you will be re-directed to the page where you have to fill in the details such as Name, Description, Inventory name, Project, Playbooks, Credentials.

Snapshot Of Creating Job Template - Ansible Tower - Edureka

Launch a Job

From the Job Templates overview screen, click the Launch button(rocket symbol) to run the Job Template. When you launch the job you can clearly see at the end of the output that the message has been printed.

Snapshot Of Launching Jobs - Ansible Tower - Edureka

So, guys, that’s an end to this blog!!

Interested In Getting DevOps Certified?

If you found this blog interesting and relevant, check out the DevOps training by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe. The Edureka DevOps Certification Training course helps learners gain expertise in various DevOps processes and tools such as Puppet, Jenkins, Nagios, Ansible, Docker, Kubernetes and GIT for automating multiple steps in SDLC.

Upcoming Batches For DevOps Certification Training Course
Course NameDateDetails
DevOps Certification Training Course

Class Starts on 23rd March,2024

23rd March

SAT&SUN (Weekend Batch)
View Details
DevOps Certification Training Course

Class Starts on 13th April,2024

13th April

SAT&SUN (Weekend Batch)
View Details
DevOps Certification Training Course

Class Starts on 15th April,2024

15th April

MON-FRI (Weekday Batch)
View Details
Comments
0 Comments

Join the discussion

Browse Categories

webinar REGISTER FOR FREE WEBINAR
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

Subscribe to our Newsletter, and get personalized recommendations.

image not found!
image not found!

Exploring Ansible Tower With A Hands-On

edureka.co