Slide 1

Slide 1 text

Automating With Michael DeHaan

Slide 2

Slide 2 text

BACKGROUND...

Slide 3

Slide 3 text

THE ANSIBLE STORY... Red Hat: Cobbler/Func Other Tools... Hosted Deployments... Lightbulb...

Slide 4

Slide 4 text

WHAT IS ANSIBLE?

Slide 5

Slide 5 text

APPLICATION DEPLOYMENT

Slide 6

Slide 6 text

CONFIGURATION MANAGEMENT

Slide 7

Slide 7 text

CLOUD PROVISIONING

Slide 8

Slide 8 text

AD-HOC TASK EXECUTION

Slide 9

Slide 9 text

MULTI-TIER ORCHESTRATION & CONTINOUS DEPLOYMENT

Slide 10

Slide 10 text

PHILOSOPHY

Slide 11

Slide 11 text

AGENTLESS!

Slide 12

Slide 12 text

SHOULDN'T BE YOUR DAY JOB

Slide 13

Slide 13 text

KEEP THINGS SIMPLE / AUDITABILITY

Slide 14

Slide 14 text

BATTERIES INCLUDED (224 MODULES IN CORE)

Slide 15

Slide 15 text

SOME STATISTICS AND INFO

Slide 16

Slide 16 text

ANSIBLE IS ~2 YEARS OLD

Slide 17

Slide 17 text

TOP 5 MOST CONTRIBUTIONS ON GITHUB IN 2013 (665+) Others were Angular.js, Rails, CocoaPods, and Homebrew

Slide 18

Slide 18 text

TOP 10 PYTHON PROJECT ON GITHUB FOR STARS (5400+) & FORKS (1600+)

Slide 19

Slide 19 text

NEW CONTRIBUTOR ADDED LESS THAN EVERY ~1.3 DAYS

Slide 20

Slide 20 text

USE CASES EXAMPLES edX.org and Fedora Infrastructure - OSSed content! Gawker - continuously deploying 5-10 times an hour MapR - product installer Rackspace - orchestrate production OpenStack upgrades Care.com, GoPro, Hootsuite, Evernote, ...

Slide 21

Slide 21 text

EXAMPLE TIME!

Slide 22

Slide 22 text

INVENTORY [ w e b s e r v e r s ] o n e . e x a m p l e . c o m t w o . e x a m p l e . c o m

Slide 23

Slide 23 text

AD-HOC MODE # a n s i b l e w e b s e r v e r s - m p i n g o n e . e x a m p l e . c o m | s u c c e s s > > { " p i n g " : " p o n g " } t w o . e x a m p l e . c o m | s u c c e s s > > { " p i n g " : " p o n g " } # a n s i b l e w e b s e r v e r s - m s h e l l - a " s h u t d o w n - t 1 2 0 "

Slide 24

Slide 24 text

PLAYBOOKS # a n s i b l e - p l a y b o o k s i t e . y m l - h o s t s : w e b s e r v e r s r o l e s : - b a s e - w e b s e r v e r - m o n i t o r e d

Slide 25

Slide 25 text

ROLES STRUCTURE r o l e s / w e b s e r v e r / t a s k s / h a n d l e r s / f i l e s / t e m p l a t e s / d e f a u l t s / v a r s / m e t a /

Slide 26

Slide 26 text

EXAMPLE TASK FILE - y u m : n a m e = h t t p d s t a t e = i n s t a l l e d - t e m p l a t e : s r c = h t t p d . c o n f . j 2 d e s t = / e t c / h t t p d / h t t p d . c o n f n o t i f y : - r e s t a r t h t t p d - s e r v i c e : n a m e = h t t p d s t a t e = r u n n i n g

Slide 27

Slide 27 text

TIPS!

Slide 28

Slide 28 text

ANSIBLE GALAXY galaxy.ansible.com about to come out of beta backed by github (issue tracking, etc) ~450 roles and 2500 users in ~4 months a n s i b l e - g a l a x y i n i t r o l e n a m e a n s i b l e - g a l a x y i n s t a l l u s e r n a m e . r o l e n a m e

Slide 29

Slide 29 text

ANSIBLE VAULT a n s i b l e - v a u l t c r e a t e f o o . y m l a n s i b l e - v a u l t e d i t f o o . y m l a n s i b l e - v a u l t e n c r y p t f o o . y m l a n s i b l e - v a u l t d e c r y p t f o o . y m l a n s i b l e - v a u l t r e k e y f o o . y m l a n s i b l e - p l a y b o o k f o o . y m l - - a s k - v a u l t - p a s s

Slide 30

Slide 30 text

ROLLING UPDATE EXAMPLE - h o s t s : w e b s e r v e r s s e r i a l : 5 p r e _ t a s k s : - n a m e : t a k e o u t o f l o a d b a l a n c e r p o o l l o c a l _ a c t i o n : c o m m a n d / u s r / b i n / t a k e _ o u t _ o f _ p o o l { { i n v e n t o r y _ h o s t n a m e } } r o l e s : - c o m m o n - w e b s e r v e r - m o n i t o r e d p o s t _ t a s k s : - n a m e : a d d b a c k t o l o a d b a l a n c e r p o o l l o c a l _ a c t i o n : c o m m a n d / u s r / b i n / a d d _ b a c k _ t o _ p o o l { { i n v e n t o r y _ h o s t n a m e } }

Slide 31

Slide 31 text

EXTENDING ANSIBLE WITH PYTHON ...

Slide 32

Slide 32 text

MODULES can implement in any language that can emit JSON or even return key=value and write one in bash core modules are all Python

Slide 33

Slide 33 text

PLUGINS lookup plugins / enumerations connection plugins action plugins filter plugins (extend Jinja2) inventory (next slide)

Slide 34

Slide 34 text

INVENTORY SCRIPTS Examples include OpenStack, AWS, and Rackspace any executable program that can emit JSON core/examples plugins are all Python

Slide 35

Slide 35 text

API/REST API python API for runner -- not the main purpose of the app REST API is part of Tower, fully discoverable, annotated, and awesome props to Django-REST-Framework

Slide 36

Slide 36 text

INTERNALS

Slide 37

Slide 37 text

REQUIREMENTS 2.6+ on server, 2.4+ on nodes python 2 for now (with good reasons) RHEL 5, I'm looking at you no bootstrapping philosophy

Slide 38

Slide 38 text

MODULES WE USE HEAVILY multiprocessing native openssh and paramiko PyYAML, json Jinja2 subprocess

Slide 39

Slide 39 text

CONTACT INFO & RESOURCES http://ansible.com [email protected] twitter: @ansible & @laserllama

Slide 40

Slide 40 text

WE ARE HIRING! (DURHAM, NC) API (Django, django-rest-framework, Celery, ...) QA (Automation) UI (Angular.js) Core (Python) email [email protected]