ANSIBLE MEETUP
AUTOMATION TO INFINITY AND BEYOND!
/Pierre Mavro @deimosfr
ABOUT THE SPEAKER
PIERRE MAVRO / @DEIMOSFR
Co-Founder
DevOps at
Worked for and
Wrote
Tech and (www.deimos.fr)
Motorcycle enthusiast
Automation and NoSQL lover
Nousmotards
Criteo
RedHat Ullink
MariaDB High Performance Book
blog wiki
ABOUT NOUSMOTARDS
is a social network for bikers made by bikers:Nousmotards
Manage events
Create road books
Easily meet new friends
...
NOUSMOTARDS ANDROID DEMO
Nousmotards android, ...
ABOUT FOUNDERS
3 friends with the same passion
SOME SEXY TECHNOS WE'RE USING
SOME USED APPS
ElasticSearch
RabbitMQ
Neo4j
Redis
MongoDB
Nginx
Haproxy
...
LANGUAGES AND FRAMEWORKS
Java
Spring Boot
Javascript
AngularJS
Python
Shell scripts
WHY DID WE CHOOSE ANSIBLE?
YAML make it simple and easy to read
Fast to write and execute
Agentless
Tons of available community plugins and role
Written in Python
Because that just ROX !!!
NOUSMOTARDS
ARCHITECTURE OVERVIEW
DEEP DIVE
ARCHITECTURE
DOCKER
What is Docker?
Simple to install (repo + packages)
Store images in a Docker registry (public/private)
Container versionning
Uses some LXC internals
Easy to use
Stable enough for small production
PACKER
What is Packer?
Define source image
Pre scripts (ansible dependencies)
Run Ansible playbook
Post scripts (clean)
Export in wished format
Push to your Docker registry
ANSIBLE
Store everything on Git
Avoid repetition (with_*)
Set multiple envs
Use vars at max
Use facts at max
Fail fast
Community: Ansible Galaxy
SMARTER IS BETTER
GIT
Keep / trace all updates from Ansible changes
Use hooks for sanity checks
JENKINS
BUILD APPS WITH DOCKER
AND PUBLISH TO PRIVATE REPO
JENKINS
BUILD CONTAINERS WITH PACKER AND ANSIBLE
THEN PUBLISH TO REGISTRY
DEPLOY: GIT + JENKINS
Git hooks and Jenkins's API
Define tag triggers within the team
JENKINS
DEPLOY NEW CONTAINERS WITH ANSIBLE
HARDER, BETTER,
FASTER, STRONGER
CONSUL
What is Consul?
Why using Consul?
Ansible deploy the servers
Ansible deploy the agents on containers
Register/unregister DNS entry with container start/stop
Use consul_io.py for Ansible inventory
CONSUL TEMPLATE
Why is this needed?
Choose a Load Balancer (like Haproxy)
Use consul-template from Ansible Galaxy
Configure Consul template for Haproxy
Run it to get HAProxy updated with consul changes
NOW IT'S OK!
LET'S SUMMARIZE IT
ANSIBLE IS EVERYWHERE!!!
To build physical servers
To build containers
To deploy containers
Integrated with Git and Jenkins
ANSIBLE CONTRIBUTIONS
Ansible Consul inventory
Roles we're sharing:
consul-template
elasticsearch
graphite
mariadb
neo4j
packer
https://galaxy.ansible.com/list#/users/3601
WHAT'S NEXT?
Waiting for Ansible v2
Making functionnal tests with Ansible
JOIN US!
www.nousmotards.com
ANSIBLE MEETUP
WWW.NOUSMOTARDS.COM
/
Watch again:
Pierre Mavro @deimosfr
http://nousmotards.github.io/ansible-meetup-0915

Ansible meetup-0915