Slide 5
Slide 5 text
ansible-playbook
おおざっぱな概略図
h1
h2
h3
h4
[db]
h1 ansible_ssh_host=192.168.0.1
h2 ansible_ssh_host=192.168.0.2
[web]
h3 ansible_ssh_host=192.168.0.3
h4 ansible_ssh_host=192.168.0.4
hosts (inventory)
ホストとグループの定義
変数も定義できる
- hosts: db
roles:
- dev-sec.mysql
- hosts: web
roles:
- nginxinc.nginx
Playbook
ホストやグループごとに何
を構成するかの定義
taskを直接書くか、あるい
はroleを指定する
nodes:
h1:
mysql_databases:
- name: customer
h2:
mysql_databases:
- name: statistics
h3:
nginx_start: false
h4:
nginx_debug_output: true
role dev-sec.mysql
role nginxinc.nginx
customer
statistics
nginx install
nginx
install
nginx
start
debug
output
外部変数ファイル
(これもinventory)
構成の設定値や挙動の指定
この例ではnodesグループのホ
ストh1,h2,h3,h4の変数を定義
している
role=定義済task
task
(mysql_db呼出)
task
(apt呼出)