SlideShare a Scribd company logo
1
Container-SIG#1
10/7/2016
Naoya Hashimoto
Ansible Container
Table of contents
• What is Ansible Container?
• Why Ansible Container Project begins?
• How to use ansible-container?
• Ansible Container Demonstration
2
Ansible Container?
3
ansible-container
shipit
push
build
run
build, run, push and shipit
init
docker-compose?
5
Feature
• Docker ImageのビルドはDockerfileからPlaybookへ
• Playbook=Ansible Moduleでビルド/デプロイ
• PlaybookはYAML形式、docker-composeユーザに優しい
6
ansible-container init (ver 0.1)
7
$ ansible-container init
$ tree ansible
ansible/
├── container.yml
├── main.yml
└── requirements.txt
ansible-container init
8
container.yml
• Dockerfileやdocker-compose.ymlに相当
• Imageやバージョン、マップするポート、環境変数などを定義
main.yml
• Master Playbook (site.yml)に相当
• イメージをビルドする際に実行するAnsibleのRoleやTaskを定義
• container.ymlが自動で生成したインベントリを参照
requirements.txt
• イメージをビルドする際に必要なPythonライブラリを定義
• pipのフォーマットに準拠
ansible-container init (ver 0.2)
9
$ ansible-container init
$ tree ansible
ansible/
├── ansible.cfg
├── container.yml
├── main.yml
├── meta.yml
├── requirements.txt
└── requirements.yml
Why Ansible Container
Project begins?
10
Ansible Container Project
“5 REASONS WE STARTED THE ANSIBLE
CONTAINER PROJECT”
https://www.ansible.com/blog/ansible-container-project
1. Because our community has been using Ansible to manage
containers for quite a while now.
2. Because the new Docker connection plug-in makes it far simpler
to run Ansible against a Docker container.
3. Because shell scripts aren’t good enough.
4. Because Ansible can be a great bridge to larger-scale container
orchestration.
5. Because we believe that communities make the best software.
11
Ansible Community & Docker
Docker ContainerをPlaybookで管理
• Docker Hubに公開しているAnsibleのイメージは約1,000件に
• メンバーが様々なDocker ContainerのベストプラクティスをBlog
に公開
• 集約されたナレッジをツールとして開発する流れに
Docker Moduleや機能を拡張
• Docker ModuleがAnsible Moduleの中で最も利用される
• Connection PluginにDocker Connection Pluginをリリース
• 初期のDocker ModuleはDeprecated
https://docs.ansible.com/ansible/guide_docker.html
• 2.2からdocker_containerやdocker_imageに置き換え
https://github.com/ansible/ansible-modules-
core/blob/devel/cloud/docker/_docker.py
12
Ansible Docker Modules & Plugins
13
Version Module/Plugin Feature
1.4
(2013)
docker
(Deprecated)
Docker Moduleのオリジナル
docker build, load, pull, push, tagなどに相当
1.6 Dynamic Inventory Docker ContainerのInventoryを動的に生成
2.0 Docker Connection Docker Containerにsshを利用せずに接続
2.0 docker_login docker login に相当
2.1 docker_service docker-composeに相当, version 1, 2に対応
2.1 docker_container Docker Containerをデプロイ
2.1 docker_image_facts Docker HostでキャッシュしたDockerイメージを
Inspect, Factsなどに利用
2.2
(2016)
docker_network docker network に相当
Docker Connection Plugin
14
Ansible 2.1でDocker Connection Pluginをリリース
• Connection DriverにDocker Connection Pluginを指定
• Playbookの実行にdocker execを利用
• PlaybookはVM, Containerで互換性を保てる?
2.1
sshd
app app
End the bash madness
15
"Ansible Container represents an end to the command
&& command && command (and so on) syntax you’ve
been struggling with to build containers.”
https://www.ansible.com/ansible-container
# grab tini for signal processing and zombie killing
ENV TINI_VERSION v0.9.0
RUN set -x 
&& curl -fSL "https://$URI/$TINI_VERSION/tini" -o /usr/local/bin/tini 
&& curl -fSL "https://$URI/$TINI_VERSION/tini.asc" -o /usr/local/bin/tini.asc 
&& export GNUPGHOME="$(mktemp -d)" 
&& gpg --keyserver ha.pool.sks-keyservers.net 
--recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 
&& gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini 
&& rm -r "$GNUPGHOME" /usr/local/bin/tini.asc 
&& chmod +x /usr/local/bin/tini 
&& tini -h
How to use
ansible-container?
16
Usage: $ ansible-container --help
17
Command Docker Command Feature
init ansible-garaxy init テンプレートを生成
build docker build
docker-compose build
Docker Imageをビルド
run docker run
docker-compose up
Docker Containerを起動
push docker push Docker RegistryにImageを
プッシュ
shipit oc new-app
oc run
オーケストレーション環境に
デプロイ
e.g. Kubernetes, OpenShift
Ansible Container Examples
18
https://github.com/ansible/ansible-container-examples
Demonstration
19
build & run
20
Prerequisites
• Python 2.7
• pip
• setuptools 20.0.0+
• Docker 1.11 or access to a Docker daemon.
Installation
$ sudo pip install ansible-container
$ ansible-container version
Build & Run
$ git clone https://github.com/ansible/ansible-container-examples.git
$ cd ansible-container-examples/ ; cp -r helloworld-nginx/ ansible
$ ansible-container build
$ ansible-container run –d
$ ansible-container stop
Push
$ docker login
$ ansible-container push
Reference
21
Ansible Container
https://github.com/ansible/ansible-container
Documentation
https://www.ansible.com/ansible-container
ansible-container-examples
https://github.com/ansible/ansible-container-examples
5 REASONS WE STARTED THE ANSIBLE CONTAINER PROJECT
https://www.ansible.com/blog/ansible-container-project
6 WAYS ANSIBLE MAKES DOCKER-COMPOSE BETTER
https://www.ansible.com/blog/six-ways-ansible-makes-docker-compose-
better
ANSIBLE AND CONTAINERS: WHY AND HOW
https://www.ansible.com/blog/ansible-and-containers-why-and-how
Q&A
22
Ad

More Related Content

What's hot (20)

Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
Philip Zheng
 
Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)
Lalatendu Mohanty
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Docker研習營
Docker研習營Docker研習營
Docker研習營
Philip Zheng
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101
Bill Maxwell
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
Kazuto Kusama
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
 
Tech Talk - Vagrant
Tech Talk - VagrantTech Talk - Vagrant
Tech Talk - Vagrant
Thomas Krille
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...
Sébastien Portebois
 
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
Yahoo!デベロッパーネットワーク
 
Docker
DockerDocker
Docker
LearningTech
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
Yuji ODA
 
容器與資料科學應用
容器與資料科學應用容器與資料科學應用
容器與資料科學應用
Philip Zheng
 
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
 [KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui... [KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
Akihiro Suda
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Chu-Siang Lai
 
The State of Rootless Containers
The State of Rootless ContainersThe State of Rootless Containers
The State of Rootless Containers
Akihiro Suda
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
Paul Chao
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
Philip Zheng
 
Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)Introduction to Project atomic (CentOS Dojo Bangalore)
Introduction to Project atomic (CentOS Dojo Bangalore)
Lalatendu Mohanty
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
Philip Zheng
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Austin - Container Days - Docker 101
Austin - Container Days - Docker 101Austin - Container Days - Docker 101
Austin - Container Days - Docker 101
Bill Maxwell
 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
Kazuto Kusama
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure이미지 기반의 배포 패러다임 Immutable infrastructure
이미지 기반의 배포 패러다임 Immutable infrastructure
Daegwon Kim
 
Docker 활용법: dumpdocker
Docker 활용법: dumpdockerDocker 활용법: dumpdocker
Docker 활용법: dumpdocker
Jaehwa Park
 
The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...The challenge of application distribution - Introduction to Docker (2014 dec ...
The challenge of application distribution - Introduction to Docker (2014 dec ...
Sébastien Portebois
 
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
"Yahoo! JAPAN の Kubernetes-as-a-Service" で加速するアプリケーション開発
Yahoo!デベロッパーネットワーク
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
Yuji ODA
 
容器與資料科學應用
容器與資料科學應用容器與資料科學應用
容器與資料科學應用
Philip Zheng
 
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
 [KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui... [KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
[KubeConUS2019 Docker, Inc. Booth] Distributed Builds on Kubernetes with Bui...
Akihiro Suda
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Chu-Siang Lai
 
The State of Rootless Containers
The State of Rootless ContainersThe State of Rootless Containers
The State of Rootless Containers
Akihiro Suda
 
Docker workshop 0507 Taichung
Docker workshop 0507 Taichung Docker workshop 0507 Taichung
Docker workshop 0507 Taichung
Paul Chao
 

Similar to Container sig#1 ansible-container (20)

PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
Hannes Hapke
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
Rafe Colton
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
Docker, Inc.
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
Alper Kanat
 
Docker 101
Docker 101 Docker 101
Docker 101
Kevin Nord
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stage
Alessandro Cinelli (cirpo)
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
Liang Bo
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
Shankar Chaudhary
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
Arun Gupta
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
Henryk Konsek
 
Ansible container
Ansible containerAnsible container
Ansible container
Scott van Kalken
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
Michelle Liu
 
The Docker Ecosystem
The Docker EcosystemThe Docker Ecosystem
The Docker Ecosystem
Dmitry Skaredov
 
DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with Docker
Docker, Inc.
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
Docker, Inc.
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
Docker, Inc.
 
Next in Virtualization Era: Containerization & Docker
Next in Virtualization Era: Containerization & DockerNext in Virtualization Era: Containerization & Docker
Next in Virtualization Era: Containerization & Docker
Alper Kanat
 
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
Jérôme Petazzoni
 
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes][HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
Wong Hoi Sing Edison
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
Hannes Hapke
 
Dockercon EU 2014
Dockercon EU 2014Dockercon EU 2014
Dockercon EU 2014
Rafe Colton
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
Docker, Inc.
 
Docker in Action
Docker in ActionDocker in Action
Docker in Action
Alper Kanat
 
Apt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stageApt get no more let Vagrant, Puppet and Docker take the stage
Apt get no more let Vagrant, Puppet and Docker take the stage
Alessandro Cinelli (cirpo)
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
Liang Bo
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
Arun Gupta
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
Henryk Konsek
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: IntroductionAgile Brown Bag - Vagrant & Docker: Introduction
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
Up and running with docker
Up and running with dockerUp and running with docker
Up and running with docker
Michelle Liu
 
DockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with DockerDockerCon EU 2015: Trading Bitcoin with Docker
DockerCon EU 2015: Trading Bitcoin with Docker
Docker, Inc.
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
Docker, Inc.
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
Docker, Inc.
 
Next in Virtualization Era: Containerization & Docker
Next in Virtualization Era: Containerization & DockerNext in Virtualization Era: Containerization & Docker
Next in Virtualization Era: Containerization & Docker
Alper Kanat
 
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
Jérôme Petazzoni
 
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes][HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
Wong Hoi Sing Edison
 
Ad

More from Naoya Hashimoto (10)

OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)
Naoya Hashimoto
 
Ansible container
Ansible containerAnsible container
Ansible container
Naoya Hashimoto
 
Aws wordpress migration@4th i jaws
Aws wordpress migration@4th i jawsAws wordpress migration@4th i jaws
Aws wordpress migration@4th i jaws
Naoya Hashimoto
 
Aws ebs snapshot with iam cross account access
Aws ebs snapshot with iam cross account accessAws ebs snapshot with iam cross account access
Aws ebs snapshot with iam cross account access
Naoya Hashimoto
 
AWS CloudFormation template with single & redundant system
AWS CloudFormation template with single & redundant systemAWS CloudFormation template with single & redundant system
AWS CloudFormation template with single & redundant system
Naoya Hashimoto
 
Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014
Naoya Hashimoto
 
Aws向け監視ソリューション比較
Aws向け監視ソリューション比較Aws向け監視ソリューション比較
Aws向け監視ソリューション比較
Naoya Hashimoto
 
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
Naoya Hashimoto
 
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
Naoya Hashimoto
 
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
Naoya Hashimoto
 
OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)OpenShift Origin Minishift (Beta)
OpenShift Origin Minishift (Beta)
Naoya Hashimoto
 
Aws wordpress migration@4th i jaws
Aws wordpress migration@4th i jawsAws wordpress migration@4th i jaws
Aws wordpress migration@4th i jaws
Naoya Hashimoto
 
Aws ebs snapshot with iam cross account access
Aws ebs snapshot with iam cross account accessAws ebs snapshot with iam cross account access
Aws ebs snapshot with iam cross account access
Naoya Hashimoto
 
AWS CloudFormation template with single & redundant system
AWS CloudFormation template with single & redundant systemAWS CloudFormation template with single & redundant system
AWS CloudFormation template with single & redundant system
Naoya Hashimoto
 
Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014Aws migration solution@JAWS DAYS 2014
Aws migration solution@JAWS DAYS 2014
Naoya Hashimoto
 
Aws向け監視ソリューション比較
Aws向け監視ソリューション比較Aws向け監視ソリューション比較
Aws向け監視ソリューション比較
Naoya Hashimoto
 
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
運用ドキュメントから見たシステム運用を考える Vol.2.2 ベンチマーク計測
Naoya Hashimoto
 
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
運用ドキュメントから見たシステム運用を考える Vol.2.2-資料一式編
Naoya Hashimoto
 
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
第1回『いまさら聞けない!システム運用・管理のコツ』 『クラウド管理・運用サービス「E.C.O」のご紹介』
Naoya Hashimoto
 
Ad

Recently uploaded (20)

Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 

Container sig#1 ansible-container

  • 2. Table of contents • What is Ansible Container? • Why Ansible Container Project begins? • How to use ansible-container? • Ansible Container Demonstration 2
  • 6. Feature • Docker ImageのビルドはDockerfileからPlaybookへ • Playbook=Ansible Moduleでビルド/デプロイ • PlaybookはYAML形式、docker-composeユーザに優しい 6
  • 7. ansible-container init (ver 0.1) 7 $ ansible-container init $ tree ansible ansible/ ├── container.yml ├── main.yml └── requirements.txt
  • 8. ansible-container init 8 container.yml • Dockerfileやdocker-compose.ymlに相当 • Imageやバージョン、マップするポート、環境変数などを定義 main.yml • Master Playbook (site.yml)に相当 • イメージをビルドする際に実行するAnsibleのRoleやTaskを定義 • container.ymlが自動で生成したインベントリを参照 requirements.txt • イメージをビルドする際に必要なPythonライブラリを定義 • pipのフォーマットに準拠
  • 9. ansible-container init (ver 0.2) 9 $ ansible-container init $ tree ansible ansible/ ├── ansible.cfg ├── container.yml ├── main.yml ├── meta.yml ├── requirements.txt └── requirements.yml
  • 11. Ansible Container Project “5 REASONS WE STARTED THE ANSIBLE CONTAINER PROJECT” https://www.ansible.com/blog/ansible-container-project 1. Because our community has been using Ansible to manage containers for quite a while now. 2. Because the new Docker connection plug-in makes it far simpler to run Ansible against a Docker container. 3. Because shell scripts aren’t good enough. 4. Because Ansible can be a great bridge to larger-scale container orchestration. 5. Because we believe that communities make the best software. 11
  • 12. Ansible Community & Docker Docker ContainerをPlaybookで管理 • Docker Hubに公開しているAnsibleのイメージは約1,000件に • メンバーが様々なDocker ContainerのベストプラクティスをBlog に公開 • 集約されたナレッジをツールとして開発する流れに Docker Moduleや機能を拡張 • Docker ModuleがAnsible Moduleの中で最も利用される • Connection PluginにDocker Connection Pluginをリリース • 初期のDocker ModuleはDeprecated https://docs.ansible.com/ansible/guide_docker.html • 2.2からdocker_containerやdocker_imageに置き換え https://github.com/ansible/ansible-modules- core/blob/devel/cloud/docker/_docker.py 12
  • 13. Ansible Docker Modules & Plugins 13 Version Module/Plugin Feature 1.4 (2013) docker (Deprecated) Docker Moduleのオリジナル docker build, load, pull, push, tagなどに相当 1.6 Dynamic Inventory Docker ContainerのInventoryを動的に生成 2.0 Docker Connection Docker Containerにsshを利用せずに接続 2.0 docker_login docker login に相当 2.1 docker_service docker-composeに相当, version 1, 2に対応 2.1 docker_container Docker Containerをデプロイ 2.1 docker_image_facts Docker HostでキャッシュしたDockerイメージを Inspect, Factsなどに利用 2.2 (2016) docker_network docker network に相当
  • 14. Docker Connection Plugin 14 Ansible 2.1でDocker Connection Pluginをリリース • Connection DriverにDocker Connection Pluginを指定 • Playbookの実行にdocker execを利用 • PlaybookはVM, Containerで互換性を保てる? 2.1 sshd app app
  • 15. End the bash madness 15 "Ansible Container represents an end to the command && command && command (and so on) syntax you’ve been struggling with to build containers.” https://www.ansible.com/ansible-container # grab tini for signal processing and zombie killing ENV TINI_VERSION v0.9.0 RUN set -x && curl -fSL "https://$URI/$TINI_VERSION/tini" -o /usr/local/bin/tini && curl -fSL "https://$URI/$TINI_VERSION/tini.asc" -o /usr/local/bin/tini.asc && export GNUPGHOME="$(mktemp -d)" && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 && gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini && rm -r "$GNUPGHOME" /usr/local/bin/tini.asc && chmod +x /usr/local/bin/tini && tini -h
  • 17. Usage: $ ansible-container --help 17 Command Docker Command Feature init ansible-garaxy init テンプレートを生成 build docker build docker-compose build Docker Imageをビルド run docker run docker-compose up Docker Containerを起動 push docker push Docker RegistryにImageを プッシュ shipit oc new-app oc run オーケストレーション環境に デプロイ e.g. Kubernetes, OpenShift
  • 20. build & run 20 Prerequisites • Python 2.7 • pip • setuptools 20.0.0+ • Docker 1.11 or access to a Docker daemon. Installation $ sudo pip install ansible-container $ ansible-container version Build & Run $ git clone https://github.com/ansible/ansible-container-examples.git $ cd ansible-container-examples/ ; cp -r helloworld-nginx/ ansible $ ansible-container build $ ansible-container run –d $ ansible-container stop Push $ docker login $ ansible-container push
  • 21. Reference 21 Ansible Container https://github.com/ansible/ansible-container Documentation https://www.ansible.com/ansible-container ansible-container-examples https://github.com/ansible/ansible-container-examples 5 REASONS WE STARTED THE ANSIBLE CONTAINER PROJECT https://www.ansible.com/blog/ansible-container-project 6 WAYS ANSIBLE MAKES DOCKER-COMPOSE BETTER https://www.ansible.com/blog/six-ways-ansible-makes-docker-compose- better ANSIBLE AND CONTAINERS: WHY AND HOW https://www.ansible.com/blog/ansible-and-containers-why-and-how