Slide 1

Slide 1 text

Creating Docker containers w/ Ansible Presented by: Roderick R. Randolph

Slide 2

Slide 2 text

Who am I • RRR • Capital One • DevOps • Amelia • Toronto Roderick R. Randolph Opinions expressed are solely my own and do not express the views or opinions of my employer. /roderickrandolph

Slide 3

Slide 3 text

Agenda • Overview • Demo • NodeJS App • Jenkins pipeline

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

What is Ansible? Ansible is an IT automation tool. It can configure systems, deploy software, and orchestrate more advanced IT tasks such as continuous deployments or zero downtime rolling updates. http://docs.ansible.com/ansible/

Slide 6

Slide 6 text

Why Ansible? • Agentless • Simple, easy to use AND read • Powerful orchestration features • Highly extensible

Slide 7

Slide 7 text

What is Ansible Container? Ansible Container is an open source project that aims to enable the automation of the entire container build, deployment and management process. https://www.ansible.com/ansible-container

Slide 8

Slide 8 text

Why Ansible Container? • Shell scripting in Dockerfiles is bad • Reuse existing Ansible modules / roles • Orchestrate across containers • Idempotent

Slide 9

Slide 9 text

How does Ansible Container work? • Docker Compose • Version 1.7.0 • Uses the Version 1 file format • Ansible Container Builder (Docker image) • Runs ansible-playbook from inside the container • Docker connection plugin (now available in Ansible 2.1) • Can be used outside of ansible-container

Slide 10

Slide 10 text

Ansible Container features (as of 9/8/16) • Build containers • Run containers • Push containers to any Docker registry • Ship containers to a Docker cloud compatible platform • Google's Kubernetes • RedHat's OpenShift

Slide 11

Slide 11 text

Demo: Triple R Tracker

Slide 12

Slide 12 text

Ansible Container gotchas and tips! • SSH is not required • Python is required to run Ansible in containers • Ansible's raw module can be used to install Python into the container • Don't mix container-managed playbooks with server-managed playbooks • Use Ansible roles to share tasks between playbooks • Ansible Galaxy roles must be installed next to the playbook vs. in the global default directory (i.e. /etc/ansible/roles) • E.g. ansible-galaxy install -p ansible/roles • Use --flatten to reduce image size • Docker-in-Docker and Ansible Container don't play well together

Slide 13

Slide 13 text

Upcoming 0.2.0 features (eta: early Oct '16) •Build Cache •Naming and tagging images •Template rendering in container.yml •Custom build variables and volumes •And more… https://docs.ansible.com/ansible-container/roadmaps/roadmap_0_2_0.html

Slide 14

Slide 14 text

Resources • Ansible Container GitHub: • https://github.com/ansible/ansible-container • Ansible Container Docs: • https://docs.ansible.com/ansible-container/ • https://www.ansible.com/blog/ansible-container-project • Demo: • http://goo.gl/DkTddK • Jenkins Pipeline: • https://jenkins.io/doc/pipeline/

Slide 15

Slide 15 text

THANK YOU capitalone.ca/careers We're hiring! /roderickrandolph