Ansible Overview

Introduction

Ansible is a configuration management tools used for servers and network devices. This document will provide an introduction to Ansible.

Ansible Overview

  • Ansible can be used for a number of functions:
    • Configuration Management - the main goal is to create a descriptive state of a server/network devices and enforce that state via configuration remediation.
    • Deployments - deploying new software over the distributed infrastructure.
    • Orchestration -deploying changes in a specific order, like web server first, sql db second…etc.
    • Provisioning - provision new servers on the public cloud like Rackspace, EC2 or Azura.
  • Ansible uses playbooks, which are the main scripts.
  • Playbooks reference hosts to configure using ordered list of tasks.
  • Task execution is performed for all hosts in parallel in other words each task is executed in parallel for each host. Until all hosts are completed for each task it doesn't proceed to the next task.
  • ansible-playbook is the main commend to run playbooks.
  • Playbooks are written in YAML.
  • Based on the playbook, Ansible generates python scripts.
  • Ansible uses the Jinja2 tempting language.
  • Some other advantages of Ansible are:
    • Using YAML for playbook, easy to read and understand.
    • No plugins or agents require on the remote hosts. Servers need ssh and Python 2.5+.
    • Push-based configuration management, where new configs are pushed to the devices without their agents checking in periodically.
  • There are three type of connections for Ansible:
    • paramiko (Python SSH Module) - used for more Cisco connections.
    • ssh (OpenSSH)
    • local - for connection to the local Ansible server.

*

Additional Resources

An Ansible Tutorial

Comments

rating: 0+x
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License