9. Copyright CA Advance,inc
9
ディレクトリ構成
基本ディレクトリ構成
- production | development
- site.yml | webservers.yml
- group_vars|host_vars/
- roles/
- common
- files
- templates
- tasks
- handlers
- Webserver
best_practices
10. Copyright CA Advance,inc
10
ディレクトリ構成 全体内容 inventory
ansible/
#構成対象のサーバーIP or FQDNファイル
production | common | development
------
$ cat development
[webservers]
192.168.0.10 ansible_ssh_private_key_file=~/.ssh/id_rsa
-------
[]はグルーピングするための設定
IPアドレスの記述と、必要であれば上記のように秘密鍵の設定値、ポート番号の埋
め込みを行うことができる
15. Copyright CA Advance,inc
15
ディレクトリ構成 全体内容 TestKitchen
$ cat test/integration/default/serverspec/localhost/webservers_spec.rb
describe package('nginx’) do
it { should be_installed } #packageが入っているか
end
describe service('nginx’) do
it { should be_enabled } # 起動ONになっているか
it { should be_running } # 動作しているか
end