Docker Cookbook


Orchestrating Containers with Ansible Docker Module | 211



Download 6,31 Mb.
Pdf ko'rish
bet171/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   167   168   169   170   171   172   173   174   ...   260
Bog'liq
Docker Cookbook

7.8 Orchestrating Containers with Ansible Docker Module | 211


changed: [192.168.33.10]
TASK: [Run mysql container] ***************************************************
ok: [192.168.33.10]
TASK: [Run wordpress container] ***********************************************
changed: [192.168.33.10]
PLAY RECAP ********************************************************************
192.168.33.10 : ok=5 changed=3 unreachable=0 failed=0
Because Ansible playbooks are written in YAML, you will notice some similarities
with the WordPress compose example in 
Recipe 7.1
:
- hosts: wordpress
tasks:
- name: Docker pull mysql
command: docker pull mysql:latest
- name: Docker pull wordpress
command: docker pull wordpress:latest
- name: Run mysql container
docker:
name=mysql
image=mysql
detach=true
env="MYSQL_ROOT_PASSWORD=wordpressdocker,MYSQL_DATABASE=wordpress, \
MYSQL_USER=wordpress,MYSQL_PASSWORD=wordpresspwd"
- name: Run wordpress container
docker:
image=wordpress
env="WORDPRESS_DB_NAME=wordpress,WORDPRESS_DB_USER=wordpress, \
WORDPRESS_DB_PASSWORD=wordpresspwd"
ports="80:80"
detach=true
links="mysql:mysql"
You have run the playbooks directly from the local machine, but
Vagrant has an Ansible provisioner. This means that you can run
the playbook when the VM is started. Go to 
ch07/ansible/solo
and
vagrant up
. The Nginx container will automatically start.
See Also

Ansible: Up and Running
, which has a section on the Docker module
212 | Chapter 7: The Docker Ecosystem: Tools


7.9 Using Rancher to Manage Containers on a Cluster of

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   167   168   169   170   171   172   173   174   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish