forked from pgstef/check_pgbackrest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
103 lines (78 loc) · 3.78 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
pgver = '12' # pg version to use
vm_prefix = 'c_pgbr_c7'
Vagrant.configure(2) do |config|
pgdata = "/var/lib/pgsql/#{pgver}/data"
config.vm.box = 'centos/7'
# hardware and host settings
config.vm.provider 'libvirt' do |lv|
lv.cpus = 1
lv.memory = 512
lv.default_prefix = vm_prefix
end
# don't mind about insecure ssh key
config.ssh.insert_key = false
# don't share the default vagrant folder
config.vm.synced_folder ".", "/vagrant", disabled: true
# mount check_pgbackrest path for testing
config.vm.synced_folder "..", "/check_pgbackrest", nfs_udp: false
# check_pgbackrest install on all the nodes
config.vm.provision 'check_pgbackrest', type: 'shell', path: 'provision/check_pgbackrest.bash'
# install PostgreSQL on all the nodes
config.vm.provision 'pgsql', type: 'shell',
path: 'provision/pgsql.bash',
args: [ pgver, pgdata ]
# ssh configuration
config.vm.synced_folder 'ssh', '/root/.ssh', type: 'rsync',
owner: 'root', group: 'root',
rsync__args: [ "--verbose", "--archive", "--delete", "--copy-links", "--no-perms" ]
# system setup for all nodes
config.vm.define "icinga-srv" do |icinga|
icinga.vm.hostname = "icinga-srv"
# icinga2 local setup
icinga.vm.provision 'icinga2', type: 'shell', path: 'provision/icinga2.bash'
# pgbackrest local setup. Use "vagrant up --provision-with=icinga2_local"
icinga.vm.provision 'icinga2_local', type: 'shell',
path: 'provision/icinga2_local.bash', run: 'never'
# pgbackrest remote setup. Use "vagrant up --provision-with=icinga2_remote"
icinga.vm.provision 'icinga2_remote', type: 'shell',
path: 'provision/icinga2_remote.bash', run: 'never'
# pgbackrest minio setup. Use "vagrant up --provision-with=icinga2_minio"
icinga.vm.provision 'icinga2_minio', type: 'shell',
path: 'provision/icinga2_minio.bash', run: 'never'
end
config.vm.define "pgsql-srv" do |pgsql|
pgsql.vm.hostname = "pgsql-srv"
# pgbackrest local setup. Use "vagrant up --provision-with=pgbackrest_local"
pgsql.vm.provision 'pgbackrest_local', type: 'shell',
path: 'provision/pgbackrest_local.bash',
args: [ pgver, pgdata ],
run: 'never'
# pgbackrest remote setup. Use "vagrant up --provision-with=pgbackrest_remote_primary"
pgsql.vm.provision 'pgbackrest_remote_primary', type: 'shell',
path: 'provision/pgbackrest_remote_primary.bash',
args: [ pgver, pgdata ],
run: 'never'
# pgbackrest minio setup. Use "vagrant up --provision-with=pgbackrest_minio"
pgsql.vm.provision 'pgbackrest_minio', type: 'shell',
path: 'provision/pgbackrest_minio.bash',
args: [ pgver, pgdata ],
run: 'never'
end
config.vm.define "backup-srv" do |backup|
backup.vm.hostname = "backup-srv"
# cifs share to store pgbackrest backups. Use "vagrant up --provision-with=cifs"
backup.vm.provision 'cifs', type: 'shell',
path: 'provision/cifs.bash', run: 'never'
# pgbackrest remote setup. Use "vagrant up --provision-with=pgbackrest_remote_standby"
backup.vm.provision 'pgbackrest_remote_standby', type: 'shell',
path: 'provision/pgbackrest_remote_standby.bash',
args: [ pgver, pgdata ],
run: 'never'
# minio local setup. Use "vagrant up --provision-with=minio"
backup.vm.provision 'minio', type: 'shell',
path: 'provision/minio.bash', run: 'never'
# minio http setup. Use "vagrant up --provision-with=minio_http"
backup.vm.provision 'minio_http', type: 'shell',
path: 'provision/minio_http.bash', run: 'never'
end
end