Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ansible (PyCON 2014, Montreal)

Ansible (PyCON 2014, Montreal)

This is not a presentation for reading by itself, but is uploaded for those who are watching along with the video here: https://www.youtube.com/watch?v=Qi0AhK7PMCI

Michael DeHaan

April 27, 2014
Tweet

More Decks by Michael DeHaan

Other Decks in Programming

Transcript

  1. TOP 5 MOST CONTRIBUTIONS ON GITHUB IN 2013 (665+) Others

    were Angular.js, Rails, CocoaPods, and Homebrew
  2. 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, ...
  3. 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
  4. 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 "
  5. 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
  6. 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 /
  7. 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
  8. 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
  9. 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
  10. 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 } }
  11. 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
  12. INVENTORY SCRIPTS Examples include OpenStack, AWS, and Rackspace any executable

    program that can emit JSON core/examples plugins are all Python
  13. 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
  14. 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