Slide 57
Slide 57 text
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.define "webserver001", primary:true do |ws001|
ws001.vm.hostname = "webserver001"
ws001.vm.network :private_network, ip: "192.168.33.10"
ws001.vm.synced_folder "./www", "/var/www"
end
config.vm.define "webserver002" do |ws002|
ws002.vm.hostname = "webserver002"
ws002.vm.network :private_network, ip: "192.168.33.11"
ws002.vm.synced_folder "./www", "/var/www"
end
config.vm.define "database001" do |db001|
db001.vm.hostname = "database001"
db001.vm.network :private_network, ip: "192.168.33.12"
end
config.vm.define "database002" do |db002|
db002.vm.hostname = "database002"
db002.vm.network :private_network, ip: "192.168.33.13"
end
config.vm.provider "virtualbox" do |vb|
vb.memory = "512"
vb.cpus = "2"
end
config.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/playbook.yml"
ansible.groups = {
"webservers" => ["webserver001", "webserver002"],
"databases" => ["database001", "database002"],
"all_groups:children" => ["webservers", "databases"]
}
end
end