Ansible

April 28, 2017

What is an Ansible?

An ansible is a category of fictional device or technology capable of instantaneous or superluminal (faster than light) communication. It can send and receive messages to and from a corresponding device over any distance or obstacle whatsoever with no delay.

- Wikipedia, 2017-04-28

What is Ansible?

  • An agentless Python based IT automation, configuration management, and deployment tool that by default operates in an ordered manner.
    • does not have a 'client' to install on remote machines
    • does have Python library dependencies
    • can run in an ad-hoc mode
    • can run against single servers, predefined groups of servers, or subset/supersets of servers
    • does operations synchronously in the order they are configured (by default)

Agentless

  • No agent required on client machines
  • Works through SSH / Powershell

Automation

  • Run commands against a single machine
  • Run commands against a 'class' of machines
    • /etc/ansible/hosts
    • use a different inventory file with '-i filename'
  • Playbooks

Configuration Management

  • Other tool options
    • Puppet
    • Chef
    • Salt
  • Provisioning new Machines
  • Changes to existing machines

Ordered Operations

  • Changes applied in same order as presented in playbook
  • Dependencies can be difficult
    • ignore_errors
  • Idempotency

Adhoc Commands

  • run a single command
  • ansible groupname -m mode -a "args"
  • Default mode is 'shell'
  • Example

Modes

  • setup
  • ​shell
  • copy
  • file
  • user
  • service
  • mysql_user
  • etc... see Ansible docs under 'Module Index'

Playbooks

  • useful with Vagrant
    • ansible
    • ansible_local
  • Ordered ops
    • ignore_errors: true
  • Example

Ansible

By davefett

Ansible

  • 742