Top Banner
ANSIBLE MEETUP AUTOMATION TO INFINITY AND BEYOND! / Pierre Mavro @deimosfr
30

Ansible meetup-0915

Feb 22, 2017

Download

Technology

Pierre Mavro
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Ansible meetup-0915

ANSIBLE MEETUPAUTOMATION TO INFINITY AND BEYOND!

/ Pierre Mavro @deimosfr

Page 2: Ansible meetup-0915

ABOUT THE SPEAKERPIERRE MAVRO / @DEIMOSFR

Co-FounderDevOps at Worked for and Wrote Tech and (www.deimos.fr)Motorcycle enthusiastAutomation and NoSQL lover

NousmotardsCriteoRedHat Ullink

MariaDB High Performance Bookblog wiki

Page 3: Ansible meetup-0915

ABOUT NOUSMOTARDS is a social network for bikers made by bikers:Nousmotards

Manage eventsCreate road booksEasily meet new friends...

Page 4: Ansible meetup-0915

NOUSMOTARDS ANDROID DEMONousmotards android, ...

Page 5: Ansible meetup-0915

ABOUT FOUNDERS

3 friends with the same passion

Page 6: Ansible meetup-0915

SOME SEXY TECHNOS WE'RE USING

Page 7: Ansible meetup-0915

SOME USED APPSElasticSearchRabbitMQNeo4jRedisMongoDBNginxHaproxy...

Page 8: Ansible meetup-0915

LANGUAGES AND FRAMEWORKSJavaSpring BootJavascriptAngularJSPythonShell scripts

Page 9: Ansible meetup-0915

WHY DID WE CHOOSE ANSIBLE?YAML make it simple and easy to readFast to write and executeAgentlessTons of available community plugins and roleWritten in PythonBecause that just ROX !!!

Page 10: Ansible meetup-0915

NOUSMOTARDS

ARCHITECTURE OVERVIEW

Page 11: Ansible meetup-0915
Page 12: Ansible meetup-0915

DEEP DIVE

ARCHITECTURE

Page 13: Ansible meetup-0915

DOCKERWhat is Docker?Simple to install (repo + packages)Store images in a Docker registry (public/private)Container versionningUses some LXC internalsEasy to useStable enough for small production

Page 14: Ansible meetup-0915

PACKERWhat is Packer?Define source imagePre scripts (ansible dependencies)Run Ansible playbookPost scripts (clean)Export in wished formatPush to your Docker registry

Page 15: Ansible meetup-0915

ANSIBLEStore everything on GitAvoid repetition (with_*)Set multiple envsUse vars at maxUse facts at maxFail fastCommunity: Ansible Galaxy

Page 16: Ansible meetup-0915

SMARTER IS BETTER

Page 17: Ansible meetup-0915

GITKeep / trace all updates from Ansible changesUse hooks for sanity checks

Page 18: Ansible meetup-0915

JENKINSBUILD APPS WITH DOCKER

AND PUBLISH TO PRIVATE REPO

Page 19: Ansible meetup-0915

JENKINSBUILD CONTAINERS WITH PACKER AND ANSIBLE

THEN PUBLISH TO REGISTRY

Page 20: Ansible meetup-0915

DEPLOY: GIT + JENKINSGit hooks and Jenkins's APIDefine tag triggers within the team

Page 21: Ansible meetup-0915

JENKINSDEPLOY NEW CONTAINERS WITH ANSIBLE

Page 22: Ansible meetup-0915

HARDER, BETTER,

FASTER, STRONGER

Page 23: Ansible meetup-0915

CONSULWhat is Consul?Why using Consul?Ansible deploy the serversAnsible deploy the agents on containersRegister/unregister DNS entry with container start/stopUse consul_io.py for Ansible inventory

Page 24: Ansible meetup-0915

CONSUL TEMPLATEWhy is this needed?Choose a Load Balancer (like Haproxy)Use consul-template from Ansible GalaxyConfigure Consul template for HaproxyRun it to get HAProxy updated with consul changes

Page 25: Ansible meetup-0915

NOW IT'S OK!

LET'S SUMMARIZE IT

Page 26: Ansible meetup-0915

ANSIBLE IS EVERYWHERE!!!To build physical serversTo build containersTo deploy containersIntegrated with Git and Jenkins

Page 27: Ansible meetup-0915

ANSIBLE CONTRIBUTIONSAnsible Consul inventoryRoles we're sharing:

consul-templateelasticsearchgraphitemariadbneo4jpacker

https://galaxy.ansible.com/list#/users/3601

Page 28: Ansible meetup-0915

WHAT'S NEXT?Waiting for Ansible v2Making functionnal tests with Ansible

Page 29: Ansible meetup-0915

JOIN US!

www.nousmotards.com

Page 30: Ansible meetup-0915

ANSIBLE MEETUPWWW.NOUSMOTARDS.COM

/

Watch again:

Pierre Mavro @deimosfr

http://nousmotards.github.io/ansible-meetup-0915