AN EARLY LOOK AT ANSIBLE CONTAINER
END THE BASH MADNESS OF COMMAND
&& COMMAND && COMMAND.
ENABLE AUTOMATION OF THE ENTIRE
CONTAINER BUILD, DEPLOYMENT, AND
MANAGEMENT PROCESS.
Keith Resar
@KeithResar
Slide 2
Slide 2 text
@KeithResar
Keith Resar: Bio
Wear many hats
@KeithResar [email protected]
Coder
Open Source Contributor and Advocate
Infrastructure Architect
Slide 3
Slide 3 text
ANSIBLE CONTAINER PROVIDES AN
ANSIBLE-CENTRIC WORKFLOW FOR BUILDING,
RUNNING, TESTING, AND DEPLOYING
CONTAINERS
Slide 4
Slide 4 text
APPLY THE POWER OF ANSIBLE AND
REUSE YOUR EXISTING ANSIBLE CONTENT
FOR YOUR CONTAINERIZED ECOSYSTEM.
Slide 5
Slide 5 text
FROM node:7.9.0
RUN mkdir -p /app
WORKDIR /app
ARG NODE_ENV dev
ENV NODE_ENV $NODE_ENV
COPY package.json /app/
RUN npm install && npm cache clean
COPY . /app/
CMD [ "npm", "start" ]
DOCKERFILE
Slide 6
Slide 6 text
ANSIBLE CONTAINER’S PROMISE
● Build container images and orchestrate them
using only Ansible playbooks
● Describe your application in a single YAML file
● See Ansible roles that make up your container
images
Slide 7
Slide 7 text
BUT WAIT, THERE’S MORE
Everything Ansible brings to orchestrating your
infrastructure can now be applied to the image
build process.
● Use templates
● Copy files
● Drop in encrypted data
● Handle errors
● Add conditionals
Slide 8
Slide 8 text
SCOPE
● Definition (instead of Dockerfile)
● Build (instead of docker build)
● Run (instead of docker-compose run)
● Deploy (to cloud env)
Slide 9
Slide 9 text
Define
deploy
build
container.yml
CONTAINER DEFINITION
run
(dev) (prod)
Slide 10
Slide 10 text
postgres
django
nginx
conductor
ORCHESTRATING THE BUILD
Slide 11
Slide 11 text
ANSIBLE CONTAINER GREENFIELD
Slide 12
Slide 12 text
ANSIBLE CONTAINER
IMPORT FROM DOCKERFILE
Slide 13
Slide 13 text
EARLY REACTIONS
● Many exceptions, not meaningful tracebacks
● Build process is still fragile
● Layering roles to build images is cool