Part 1 – Introduction to Ansible

Ansible is one of the most popular configuration management tools out there. Ansible helps in Change Management, Provisioning, Automation and Orchestration of the infrastructure. Ansible is secure because it uses SSH to communicate with the managed nodes. Ansible is an agentless solution written in Python. Ansible instructions are written in YAML and a little knowledge on yaml helps. Ansible works on push based execution of commands.

Below is the terminology we need to get acquainted with before actually moving any further.

Ansible Controller The machine where Ansible is installed, Controller can be any machine including your own laptop; instructions are executed using Python. Ideally Ansible is installed on a server.

Managed Nodes The server machines to which the instructions are deployed by controller, these instructions are written in YAML

Inventory File that holds the hostnames/IPs of the managed nodes. The nodes can be part of group or group of groups

PlayBooks Collection of plays, which are deployment instructions. PlayBooks can combine execution of multiple modules. Playbooks are written in YAML.

Modules Built in Commands that Ansible can execute are called modules. Ex: ping, yum

Roles Grouping of related files with a directory based structure depending on the functionality. Roles help is avoiding explicit path mentions when accessing content in various directories.

Ansible Tower Solution which provides Central management point which has GUI, API and CLI for team of users to track playbooks and jobs that run. This is not free btw.

Controller must have Python 2.5 or higher for executing instructions on Managed Nodes and Managed Nodes must also have Python 2.5 or higher. If Python is below 2.5, JSON interpreter has to be installed separately. Controller and Managed Nodes communicate using the SSH

Note: For servers running Python 3, for Ansible to work, it is not recommended to uninstall version 3 to install 2.x. Install version 2.6 over version 3 and while executing, specify the path of version 2.x for variable ansible_python_interpreter in the inventory file.


Courtesy ©VMware Press Technology

Hope this was informative. Thanks!

 Part 1 – Introduction to Ansible

Part 2 – Ansible Lab Setup

Part 3 – Understanding our First Ansible Command

Part 4 – More about Inventory File

Part 5 – Ansible Config

Part 6 – Ansible Modules

Part 7 – Ansible Tasks, Plays, PlayBooks

Part 8 – Ansible Play Recap, vars, Notify, Handlers

Part 9 – Ansible Roles


#ansible, #controllers, #introduction, #playbooks, #roles