柿途中

Ansible playbook の構成 †

Vagrant と Ansible について †

Ansible Playbook の設定ファイル †

https://github.com/kagyuu/ansible_gis/blob/master/ansible.cfg

[defaults]
inventory = hosts
host_key_checking = False
pipelining = True


https://github.com/kagyuu/ansible_gis/blob/master/hosts

[vagrant]
gis
インストールするホストとグループを定義する。ansible.cfg に定義されている hostsファイル
本番環境では、ある程度設定内容が共通なものをグループ化して

[web]
web1
web2
web3

[db]
db1
db2

というようにする。


https://github.com/kagyuu/ansible_gis/blob/master/group_vars/all.yml

---
COLON: ':'
MINUS: '-'
共通設定。エスケープ文字を定義する


https://github.com/kagyuu/ansible_gis/blob/master/group_vars/vagrant.yml

---
ansible_ssh_user: vagrant
Vagrantグループ共通の設定


https://github.com/kagyuu/ansible_gis/blob/master/host_vars/gis.yml

---
ansible_ssh_host: 127.0.0.1
ansible_ssh_port: 2222
ansible_ssh_private_key_file: .vagrant/machines/gis/virtualbox/private_key
gisサーバ固有の設定。
gisサーバの設定は all + Vagrantグループの設定内容 + gisサーバ固有の設定

今宵はここまで †

Ansible Playbook の処理の流れ †

メイン部 (gis.yml) †

サブルーチン部 (roles/) †

共通サブルーチンについて (ansible_common/roles/) †

最初から最後まで流しで見てみる †


Ansible


Last-modified: 2017-03-10 (金) 01:47:26 (3542d)
Short-URL: https://pukiwiki.at-sushi.com/pukiwiki/?cmd=s&k=643c9abbc1
ISBN10
ISBN13
9784061426061