Ansible Meetup

Automation to infinity and beyond!

Pierre Mavro / @deimosfr

About the Speaker

Pierre Mavro / @Deimosfr

About Nousmotards

Nousmotards is a social network for bikers made by bikers:

  • Manage events
  • Create road books
  • Easily meet new friends
  • ...

Nousmotards Android Demo

About Founders

3 friends with the same passion

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 !!!


Architecture overview

Deep dive



  • 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


  • 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


  • 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


  • Keep / trace all updates from Ansible changes
  • Use hooks for sanity checks


Build apps with Docker
and publish to private repo


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


Deploy new containers with Ansible

Harder, better,

faster, stronger


  • 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 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

What's next?

  • Waiting for Ansible v2
  • Making functionnal tests with Ansible

Join us!

Ansible Meetup

Pierre Mavro / @deimosfr
Watch again: