on page 23 of the book
This commit is contained in:
parent
75856335f1
commit
b683d061d8
3 changed files with 51 additions and 0 deletions
25
Vagrantfile
vendored
Normal file
25
Vagrantfile
vendored
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
config.vm.box = "generic/rocky9"
|
||||||
|
config.ssh.insert_key = false
|
||||||
|
config.vm.synced_folder "." "/vagrant", disabled: true
|
||||||
|
|
||||||
|
config.vm.provider :virtualbox do |v|
|
||||||
|
v.memory = 512
|
||||||
|
v.linked_clone = true
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "app1" do |app|
|
||||||
|
app.vm.hostname = "orc-app1.test"
|
||||||
|
app.vm.network :private_network, ip: "192.168.60.4"
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "app2" do |app|
|
||||||
|
app.vm.hostname = "orc-app2.test"
|
||||||
|
app.vm.network :private_network, ip: "192.168.60.5"
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.define "db" do |db|
|
||||||
|
db.vm.hostname = "orc-db.test"
|
||||||
|
db.vm.network :private_network, ip: "192.168.60.6"
|
||||||
|
end
|
||||||
|
end
|
8
ansible.cfg
Normal file
8
ansible.cfg
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[defaults]
|
||||||
|
inventory = hosts.ini
|
||||||
|
gathering = smart
|
||||||
|
transport = ssh
|
||||||
|
|
||||||
|
[ssh_connection]
|
||||||
|
# ssh_args =
|
||||||
|
# pipelining =
|
18
hosts.ini
Normal file
18
hosts.ini
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Application servers
|
||||||
|
[app]
|
||||||
|
192.168.60.4
|
||||||
|
192.168.60.5
|
||||||
|
|
||||||
|
# Database server
|
||||||
|
[db]
|
||||||
|
192.168.60.6
|
||||||
|
|
||||||
|
# Group named "multi" with all servers
|
||||||
|
[multi:children]
|
||||||
|
app
|
||||||
|
db
|
||||||
|
|
||||||
|
# Variables that will be applied to all servers
|
||||||
|
[multi:vars]
|
||||||
|
ansible_user=vagrant
|
||||||
|
; ansible_ssh_private_key_file=~/.vagrant.d/insecure_private_key
|
Loading…
Add table
Reference in a new issue