SlideShare ist ein Scribd-Unternehmen logo
1 von 19
Downloaden Sie, um offline zu lesen
HELLO WORLD! 
Toshio Kuratomi 
Worked for Red Hat on the Fedora Infrastructure Team 
Little bit of sysadmin work 
Gobs of Python
FUN WITH CONTAINERS 
and 
Toshio Kuratomi
WHAT IS DOCKER? 
Manages Linux containers 
Allows deploying applications in isolation 
Docker Hub ecosystem for distributing general containers
IMAGES 
Made of layers 
Base Images basically OS installs 
Immutable 
Customize by creating a new layer on top
WHAT CAN I DO WITH IT? 
Lightweight cloud 
Tool for encapsulating applications
LIGHTWEIGHT CLOUD 
Lower runtime overhead 
Layered filesystem 
Very quick startup time
ENCAPSULATED APPLICATIONS 
Low overhead 
Run application on startup 
Similar to init
GREAT! SO WHAT'S ANSIBLE GOT TO DO WITH IT?
BUILDING AN IMAGE (DOCKERFILE) 
FROM centos:stable 
RUN yum -y upgrade 
RUN yum install httpd 
COPY httpd.conf /etc/httpd/conf/httpd.conf 
EXPOSE 80 
ENTRYPOINT ["/usr/sbin/apachectl", "-DFOREGOUND"]
BUILDING AN IMAGE (WITH ANSIBLE) 
FROM ansible/centos7-ansible:stable 
ADD ansible /srv/example/ 
WORKDIR /srv/example 
RUN ansible-playbook site.yml -c local 
EXPOSE 80 
ENTRYPOINT ["/usr/sbin/apachectl", "-DFOREGROUND"]
BUILDING AN IMAGE (WITH ANSIBLE) 
ansible/site.yml: 
- hosts: localhost 
tasks: 
- yum: pkg=httpd state=present 
- copy: 
src: httpd.conf 
dest: /etc/httpd/conf/httpd.conf 
group: "apache" 
mode: "0644"
HUH. SO WHAT MAKES ANSIBLE BETTER? 
Power and consistency 
Same method to configure images as your hosts 
Templates and Conditionals 
Portability 
Try out new things via Galaxy roles
A MORE COMPLEX EXAMPLE! 
- hosts: localhost 
vars: 
apache_group: 
Debian: "root" 
RedHat: "apache" 
apache_ctl: 
Debian: "/usr/sbin/apache2ctl" 
RedHat: "/usr/sbin/apachectl"
A MORE COMPLEX EXAMPLE! 
tasks: 
- yum: pkg=httpd state=present 
when: ansible_os_family == "RedHat" 
- apt: update_cache=yes name="apache2" state=present 
when: ansible_os_family == "Debian" 
- name: Make an apachectl symlink that is the same between distros 
file: 
state: link 
src: "{{apache_ctl[ansible_os_family]}}" 
dest: /usr/local/bin/apachectl
A MORE COMPLEX EXAMPLE! 
- name: Apply httpd configuration from template 
template: 
src: httpd.conf.j2 
dest: /etc/httpd/conf/httpd.conf 
group: "{{ apache_group[ansible_os_family] }}" 
mode: "0644"
GALAXY + DOCKER == TRY BEFORE YOU BUY 
FROM ansible/ubuntu14.04-ansible:stable 
RUN mkdir /srv/example 
WORKDIR /srv/example 
ADD site.yml /srv/example/ 
RUN ansible-galaxy install geerlingguy.memcached 
RUN ansible-playbook site.yml -c local 
EXPOSE 11211 
ENTRYPOINT ["/usr/bin/memcached", "-u", "memcache", "-l", "0.0.0.0", "-c" "1024", "-p",
GALAXY + DOCKER == TRY BEFORE YOU BUY 
- hosts: localhost 
roles: 
- role: geerlingguy.memcached
IMAGES FOR BUILDING 
Ansible layered on a Base OS Image 
Building four images 
Two images for Ubuntu-14.04 
Two images for CentOS-7 
An image for Ansible HEAD 
An image for the Ansible release on pypi
CONTACT INFO & RESOURCES 
https://registry.hub.docker.com/u/ansible/centos7-ansible/ 
https://registry.hub.docker.com/u/ansible/ubuntu14.04-ansible/ 
http://ansible.github.com/ansible/ansible-docker-base 
http://ansible.com 
tkuratomi@ansible.com

Weitere ähnliche Inhalte

Was ist angesagt?

Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and Ansible
Dmytro Slupytskyi
 

Was ist angesagt? (20)

Infrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & AnsibleInfrastructure Deployment with Docker & Ansible
Infrastructure Deployment with Docker & Ansible
 
Hands-On Session Docker
Hands-On Session DockerHands-On Session Docker
Hands-On Session Docker
 
Automatic docker service announcement with registrator and confd
Automatic docker service announcement with registrator and confdAutomatic docker service announcement with registrator and confd
Automatic docker service announcement with registrator and confd
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
Very Early Review - Rocket(CoreOS)
Very Early Review - Rocket(CoreOS)Very Early Review - Rocket(CoreOS)
Very Early Review - Rocket(CoreOS)
 
Continuous integration with Docker and Ansible
Continuous integration with Docker and AnsibleContinuous integration with Docker and Ansible
Continuous integration with Docker and Ansible
 
Cyansible
CyansibleCyansible
Cyansible
 
Kubernetes Boston — Custom High Availability of Kubernetes
Kubernetes Boston — Custom High Availability of KubernetesKubernetes Boston — Custom High Availability of Kubernetes
Kubernetes Boston — Custom High Availability of Kubernetes
 
Launching containers with fleet
Launching containers with fleetLaunching containers with fleet
Launching containers with fleet
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
 
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
Building and Testing from Scratch a Puppet Environment with Docker - PuppetCo...
 
Ansible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife OrchestrationAnsible - Swiss Army Knife Orchestration
Ansible - Swiss Army Knife Orchestration
 
Fabric: A Capistrano Alternative
Fabric:  A Capistrano AlternativeFabric:  A Capistrano Alternative
Fabric: A Capistrano Alternative
 
Managing Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with AnsibleManaging Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with Ansible
 
Docker use dockerfile
Docker use dockerfileDocker use dockerfile
Docker use dockerfile
 
Hadoop on ec2
Hadoop on ec2Hadoop on ec2
Hadoop on ec2
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Quay 3.3 installation
Quay 3.3 installationQuay 3.3 installation
Quay 3.3 installation
 

Andere mochten auch

August 2016 HUG: Open Source Big Data Ingest with StreamSets Data Collector
August 2016 HUG: Open Source Big Data Ingest with StreamSets Data Collector August 2016 HUG: Open Source Big Data Ingest with StreamSets Data Collector
August 2016 HUG: Open Source Big Data Ingest with StreamSets Data Collector
Yahoo Developer Network
 
A new model for Docker image distribution
A new model for Docker image distributionA new model for Docker image distribution
A new model for Docker image distribution
Docker, Inc.
 
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker Hub: Past, Present and Future by Ken Cochrane & BC WongDocker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker, Inc.
 

Andere mochten auch (18)

Docker Meetup Paris: enterprise Docker
Docker Meetup Paris: enterprise DockerDocker Meetup Paris: enterprise Docker
Docker Meetup Paris: enterprise Docker
 
Docker Build
Docker BuildDocker Build
Docker Build
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 
Docker - Build, Ship and Run Any App, Anywhere Hollywood edition
Docker - Build, Ship and Run Any App, Anywhere Hollywood editionDocker - Build, Ship and Run Any App, Anywhere Hollywood edition
Docker - Build, Ship and Run Any App, Anywhere Hollywood edition
 
Docker on AWS - the Right Way
Docker on AWS - the Right WayDocker on AWS - the Right Way
Docker on AWS - the Right Way
 
Spark Summit Europe 2016 Keynote - Databricks CEO
Spark Summit Europe 2016 Keynote  - Databricks CEO Spark Summit Europe 2016 Keynote  - Databricks CEO
Spark Summit Europe 2016 Keynote - Databricks CEO
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWSGDGSCL - Docker a jeho provoz v Heroku a AWS
GDGSCL - Docker a jeho provoz v Heroku a AWS
 
Spark Summit EU 2016 Keynote - Simplifying Big Data in Apache Spark 2.0
Spark Summit EU 2016 Keynote - Simplifying Big Data in Apache Spark 2.0Spark Summit EU 2016 Keynote - Simplifying Big Data in Apache Spark 2.0
Spark Summit EU 2016 Keynote - Simplifying Big Data in Apache Spark 2.0
 
August 2016 HUG: Open Source Big Data Ingest with StreamSets Data Collector
August 2016 HUG: Open Source Big Data Ingest with StreamSets Data Collector August 2016 HUG: Open Source Big Data Ingest with StreamSets Data Collector
August 2016 HUG: Open Source Big Data Ingest with StreamSets Data Collector
 
Docker Hub Breakout Session at DockerCon by Ken Cochrane
Docker Hub Breakout Session at DockerCon by Ken CochraneDocker Hub Breakout Session at DockerCon by Ken Cochrane
Docker Hub Breakout Session at DockerCon by Ken Cochrane
 
Parallelizing Existing R Packages with SparkR
Parallelizing Existing R Packages with SparkRParallelizing Existing R Packages with SparkR
Parallelizing Existing R Packages with SparkR
 
A new model for Docker image distribution
A new model for Docker image distributionA new model for Docker image distribution
A new model for Docker image distribution
 
Modelo de carta formal e informal com exemplos
Modelo de carta formal e informal com exemplosModelo de carta formal e informal com exemplos
Modelo de carta formal e informal com exemplos
 
Kubernetes Meetup Paris #5 - Metriques applicatives k8s
Kubernetes Meetup Paris #5 - Metriques applicatives k8sKubernetes Meetup Paris #5 - Metriques applicatives k8s
Kubernetes Meetup Paris #5 - Metriques applicatives k8s
 
Introducing apache prediction io (incubating) (bay area spark meetup at sales...
Introducing apache prediction io (incubating) (bay area spark meetup at sales...Introducing apache prediction io (incubating) (bay area spark meetup at sales...
Introducing apache prediction io (incubating) (bay area spark meetup at sales...
 
TensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache SparkTensorFrames: Google Tensorflow on Apache Spark
TensorFrames: Google Tensorflow on Apache Spark
 
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker Hub: Past, Present and Future by Ken Cochrane & BC WongDocker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
 
Docker 101 - Nov 2016
Docker 101 - Nov 2016Docker 101 - Nov 2016
Docker 101 - Nov 2016
 

Ähnlich wie Fun with containers: Use Ansible to build Docker images

Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
Docker, Inc.
 

Ähnlich wie Fun with containers: Use Ansible to build Docker images (20)

Docker for developers on mac and windows
Docker for developers on mac and windowsDocker for developers on mac and windows
Docker for developers on mac and windows
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Ansible new paradigms for orchestration
Ansible new paradigms for orchestrationAnsible new paradigms for orchestration
Ansible new paradigms for orchestration
 
Docker Starter Pack
Docker Starter PackDocker Starter Pack
Docker Starter Pack
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
 
Docker perl build
Docker perl buildDocker perl build
Docker perl build
 
Shipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with DockerShipping Applications to Production in Containers with Docker
Shipping Applications to Production in Containers with Docker
 
Docker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing MeetupDocker Tips And Tricks at the Docker Beijing Meetup
Docker Tips And Tricks at the Docker Beijing Meetup
 
Lumen
LumenLumen
Lumen
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Introduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureIntroduction to Docker and deployment and Azure
Introduction to Docker and deployment and Azure
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Docker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in ProductionDocker Online Meetup #3: Docker in Production
Docker Online Meetup #3: Docker in Production
 
Docker
DockerDocker
Docker
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveThe Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 

Fun with containers: Use Ansible to build Docker images

  • 1. HELLO WORLD! Toshio Kuratomi Worked for Red Hat on the Fedora Infrastructure Team Little bit of sysadmin work Gobs of Python
  • 2. FUN WITH CONTAINERS and Toshio Kuratomi
  • 3. WHAT IS DOCKER? Manages Linux containers Allows deploying applications in isolation Docker Hub ecosystem for distributing general containers
  • 4. IMAGES Made of layers Base Images basically OS installs Immutable Customize by creating a new layer on top
  • 5. WHAT CAN I DO WITH IT? Lightweight cloud Tool for encapsulating applications
  • 6. LIGHTWEIGHT CLOUD Lower runtime overhead Layered filesystem Very quick startup time
  • 7. ENCAPSULATED APPLICATIONS Low overhead Run application on startup Similar to init
  • 8. GREAT! SO WHAT'S ANSIBLE GOT TO DO WITH IT?
  • 9. BUILDING AN IMAGE (DOCKERFILE) FROM centos:stable RUN yum -y upgrade RUN yum install httpd COPY httpd.conf /etc/httpd/conf/httpd.conf EXPOSE 80 ENTRYPOINT ["/usr/sbin/apachectl", "-DFOREGOUND"]
  • 10. BUILDING AN IMAGE (WITH ANSIBLE) FROM ansible/centos7-ansible:stable ADD ansible /srv/example/ WORKDIR /srv/example RUN ansible-playbook site.yml -c local EXPOSE 80 ENTRYPOINT ["/usr/sbin/apachectl", "-DFOREGROUND"]
  • 11. BUILDING AN IMAGE (WITH ANSIBLE) ansible/site.yml: - hosts: localhost tasks: - yum: pkg=httpd state=present - copy: src: httpd.conf dest: /etc/httpd/conf/httpd.conf group: "apache" mode: "0644"
  • 12. HUH. SO WHAT MAKES ANSIBLE BETTER? Power and consistency Same method to configure images as your hosts Templates and Conditionals Portability Try out new things via Galaxy roles
  • 13. A MORE COMPLEX EXAMPLE! - hosts: localhost vars: apache_group: Debian: "root" RedHat: "apache" apache_ctl: Debian: "/usr/sbin/apache2ctl" RedHat: "/usr/sbin/apachectl"
  • 14. A MORE COMPLEX EXAMPLE! tasks: - yum: pkg=httpd state=present when: ansible_os_family == "RedHat" - apt: update_cache=yes name="apache2" state=present when: ansible_os_family == "Debian" - name: Make an apachectl symlink that is the same between distros file: state: link src: "{{apache_ctl[ansible_os_family]}}" dest: /usr/local/bin/apachectl
  • 15. A MORE COMPLEX EXAMPLE! - name: Apply httpd configuration from template template: src: httpd.conf.j2 dest: /etc/httpd/conf/httpd.conf group: "{{ apache_group[ansible_os_family] }}" mode: "0644"
  • 16. GALAXY + DOCKER == TRY BEFORE YOU BUY FROM ansible/ubuntu14.04-ansible:stable RUN mkdir /srv/example WORKDIR /srv/example ADD site.yml /srv/example/ RUN ansible-galaxy install geerlingguy.memcached RUN ansible-playbook site.yml -c local EXPOSE 11211 ENTRYPOINT ["/usr/bin/memcached", "-u", "memcache", "-l", "0.0.0.0", "-c" "1024", "-p",
  • 17. GALAXY + DOCKER == TRY BEFORE YOU BUY - hosts: localhost roles: - role: geerlingguy.memcached
  • 18. IMAGES FOR BUILDING Ansible layered on a Base OS Image Building four images Two images for Ubuntu-14.04 Two images for CentOS-7 An image for Ansible HEAD An image for the Ansible release on pypi
  • 19. CONTACT INFO & RESOURCES https://registry.hub.docker.com/u/ansible/centos7-ansible/ https://registry.hub.docker.com/u/ansible/ubuntu14.04-ansible/ http://ansible.github.com/ansible/ansible-docker-base http://ansible.com tkuratomi@ansible.com