Ansible

Introduction

why ansible ?

1980s - Personal computers

1960s - mainframes

1980s - Client Server

1990s - web enterprises

2000s -Cloud

devOPS

Manual

Scripts

IaaC

remote management

  • func
  • pssh
  • cluster-ssh
  • parallel-ssh

CONFIGURATIOn management

Deployments and orchestration

capistrano

fabric

provisioning tools

 cloud formation

heat

terraform

configuration management

provisioniong

deployment and orchestration

ad hoc server management

ansible

5 FEATURES

  1. Simplicity
  2. Batteries Included
  3. Infrastructure as a Code
  4. Code vs Data
  5. Idempotence

simplicity

  • SIMPLE TO LEARN

  • SIMPLE to setup

 Simple Things should be simple, complex things should be possible

- Alan Kay

YAML

---
- hosts: all
  remote_user: vagrant
  sudo: yes
  tasks: 
  - name: create devops user with admin previleges
    user: > 
     name=xyz 
     uid=2001 
     group=pqr
     password=er867!fe%rger93$#c

agent less

push model

  • Uses SSH / WinRM
  • Simple to Setup
  • Smaller Footprint
  • Secure

push 

pull 

vs

Agent

Agent

Agent

450+
Modules

batteries included

batteries included

systems

cloud

containers

monitoring tools

collaboration tools

network

source control

21

catagories

Infrastructure as a Code
---
- hosts: all
  remote_user: vagrant
  sudo: yes
  tasks: 
  - name: create devops user with admin previleges
    user: > 
     name=xyz 
     uid=2001 
     group=pqr
     password=er867!fe%rger93$#c

SCRIPTS      |      ANSIBLE

python

perl

shell

HOW

what

user
name      = xyz
shell     = /bin/bash 
uid       = 5001
group     = xyz
password  = w&*Tnkj23sa
version control
Editing and Refactoring Tools
Peer Reviews

TDD

code

 data

vs

port = 80
user = apache
conn = 1024
port = 8080
user = www-data
conn = 512
port = 9000
user = httpd
conn = 4096

profile 1 

profile 2

profile 3

port = 80
user = apache
conn = 1024

code

data

vars

tasks

templates

port = {{ port }}
user = {{ user }}
conn = {{ conn }}

roles 

generic
sharable

idempotencE

ƒ ( ƒ ( x ) ) =  ƒ (x )

idempotencE

ƒ ( ƒ ( x ) ) =  ƒ (x )

Idempotence is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application.  
Which can be simply represented by, 

Lets simplify that a bit.....

First time I read that, I had the same expressions  !!

Goa

Bangalore

chennai

Mumbai

1

2

3

how is it relevant to ansible ?

  • Ansible runs are invoked multiple times
  • Every time, it compares the desired state vs current state. And the decides whether to take an action, or to skip. 

desired

desired

current

current

task 1 
task 2 
task 3
task 4
task 5 
task 6 
task 7 
task 8
task 1 
task 2 
task 3
task 4
task 5 
task 6 
task 7 
task 8
task 1 
task 2 
task 3
task 4
task 5 
task 6 
task 7 
task 8

1st Run

2nd Run

3rd Run

THE STORY

2012

Michael dehaan

2006 - Emerging Technologies Group, RedHat

Cobbler

Func

Product Manager, Puppet Labs

Ansible

ansible inc

Ansible Works  => Ansible Inc

2013

  • Said Ziouani
  • Michael DeHaan 
  • Tim Gerla

ansible ?

Ansible(noun):  a fictional machine capable of communicating faster than the speed of light. 

Coined by Ursula K. Le Guin  in her 1966 novel Rocannon's World

RedHat

2015

src: http://www.businesswire.com/news/home/20151016005177/en

2014

2016

Releases

Led Zeppelin songs

Van Halen songs

Copy of Ansible 1: Introduction to Ansible

By School of Devops

Copy of Ansible 1: Introduction to Ansible

Overview of What Ansible is.

  • 1,020