ansible, automation,

Ansible - Learning Docs & References

Follow · 8 mins read
Ansible - Learning Docs & References
Share this

Ansible for Absolute Beginners

Ansible Guides

Automation with Ansible – All You Want to Learn

You have hundreds and thousands of online documentation and wiki pages for learning Ansible, and this is my attempt to cover Ansible in a simple and beginner level approach. Access all chapters on

Table of Contents

Ansible - Frequently Asked Questions

  1. What is Ansible?
  2. What is IaC?
  3. What can Ansible do?
  4. What are the advantages of Ansible?
  5. How does Ansible work?
  6. What is a Playbook?
  7. Are there any requirements for using Ansible?
  8. What is DevOps?
  9. How does Ansible fit into DevOps?
  10. Who is Ansible for? Who should learn Ansible?
  11. What are prerequisites to learning Ansible?s

Ansible Automation Platform (Ansible Tower)

Installing Ansible Automation Platform (Ansible Tower)

Note : The Ansible Automation Platform installer only supports Red Hat Enterprise Linux and CentOS.

Enable RHEL and AAP Subscriptions

Make sure you subscribed to Red Hat and added RHEL Subscription.

# subscription-manager register
# subscription-manager attach --pool=<pool_id of RHEL subscription>
# subscription-manager list --consumed

Now, search for Ansible Automation Platform subscription and attach the pool ID.

# subscription-manager list --available --all | grep "Ansible Automation Platform" -B 3 -A 6
# subscription-manager attach --pool=<pool_id>
# subscription-manager list --consumed

Update required repo for AAP 2.1

# subscription-manager repos \

# subscription-manager repos \

Prepare for Ansible Automation Platform Installation

  1. Download the latest Ansible Automation Platform Installation Program from or from Refer Download the Ansible Automation Platform Installation Program for more details.

Note: You can download either installation package or bundled package (for disconnected setup).

  1. Extract the content
$ tar xvzf ansible-tower-setup-latest.tar.gz
$ cd ansible-tower-setup-<tower_version>

Get Registry Credential

You need access to Red Hat Container Registry to fetch the continer images for automation controller and execution environment. You can create a service account in Red Hat registry for the same and use the credential in AAP installation inventory.

# Execution Environment Configuration
# Credentials for container registry to pull execution environment images from,
# comment out registry_username if authentication is not required

Read more Registry Service Account Management Application

Configure Ansible Automation Platform Installation Inventory

Run Setup Script

# ./

You can ignore ignore_preflight_errors if you are testing or preparing home labs.

# ./ ignore_preflight_errors=true

Root access to the remote machines is required, you need to use any of the below methods

$ ansible_user=root ansible_ssh_pass=”your_password_here” inventory host or group variables
# or
$ ansible_user=root ansible_ssh_private_key_file=”path_to_your_keyfile.pem” inventory host or group variables
# or

Ansible Tower HA and DR

Ansible Tower with database SSL connection enabled

Verify SSL Certificate-Key pair

If all the three match, the SSL certificate matches the Private Key.

# SSL certificate
$ openssl x509 –noout –modulus –in <file>.crt | openssl md5

# RSA private key
$ openssl rsa –noout –modulus –in <file>.key | openssl md5

$ openssl req -noout -modulus -in <file>.csr | openssl md5

SSL Certificate with Passphrase



Ansible Automation Hub


Ansible Playbook References

Tools for Ansible

Ansible for Network Automation

Ansible and Python Modules

pip install --target=/your/pyinstalldir loremipsum
pip install fortiosapi --target=/var/lib/awx/venv/ansible/lib/python2.7/site-packages

pip list --target=/var/lib/awx/venv/ansible/lib/python2.7/site-packages
# subscription-manager repos --enable rhel-server-rhscl-7-rpms
# yum install python27-python-pip

Switch to a normal user and check the pip

$ scl enable python27 bash
$ which pip
$ pip -V

For Existing Tower

# source /var/lib/awx/venv/ansible/bin/activate
# umask 0022
# pip install --upgrade pywinrm
# deactivate

Ansible and Python 3

Ansible 2.5 and above work with Python 3.

[[email protected] ~]$ ansible --version |grep python
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  python version = 2.7.5 (default, Sep 26 2019, 13:23:47) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

Ansible Blog/Articles to Follow

Ansible Interview Questions

Ansible Modules

Other References

Ansible for IBM Power

Ansible for Arista Networks

Ansible for CIS Hardening/CIS Check

Latest Stories