2017-02-17 21:30:58 +01:00
|
|
|
# -*- mode: ruby -*-
|
|
|
|
# vi: set ft=ruby :
|
|
|
|
|
2020-03-04 13:56:20 +01:00
|
|
|
system("scripts/pregen_keys.sh")
|
|
|
|
|
2017-02-17 21:30:58 +01:00
|
|
|
Vagrant.configure("2") do |config|
|
2023-05-06 13:17:03 +02:00
|
|
|
config.vm.box = "generic/debian10"
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.post_up_message = nil
|
2023-05-06 13:17:03 +02:00
|
|
|
config.vm.synced_folder ".", "/vagrant", disabled: true, type: "9p"
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2020-03-04 13:56:20 +01:00
|
|
|
config.vm.provision :shell,
|
|
|
|
path: "scripts/change-vmdebootstrap-default-dhcp.sh"
|
|
|
|
#config.vm.provision "shell",
|
|
|
|
# inline: "sed -i 's/^mesg n$/tty -s \\&\\& mesg n/g' /root/.profile"
|
2017-02-18 13:29:18 +01:00
|
|
|
config.vm.provision "shell",
|
|
|
|
path: "scripts/add_salt_to_etc_hosts.sh"
|
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "salt" do |node|
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.hostname = "salt"
|
2017-02-17 23:00:27 +01:00
|
|
|
node.vm.network "private_network", ip: "172.16.4.10"
|
2023-05-06 13:17:03 +02:00
|
|
|
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
2023-05-06 13:17:03 +02:00
|
|
|
libvirt.cpus = 2
|
|
|
|
libvirt.memory = 2048
|
|
|
|
libvirt.memorybacking :access, :mode => "shared"
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
2017-02-18 13:29:18 +01:00
|
|
|
|
2023-05-06 13:17:03 +02:00
|
|
|
node.vm.synced_folder "../gvasalt/states", "/srv/salt", type: "9p"
|
|
|
|
node.vm.synced_folder "../gvasalt/pillar", "/srv/pillar", type: "9p"
|
|
|
|
|
2017-02-18 13:29:18 +01:00
|
|
|
node.vm.provision :salt do |salt|
|
2020-03-04 13:56:20 +01:00
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/salt"
|
2017-02-18 13:29:18 +01:00
|
|
|
salt.install_master = true
|
2020-03-04 13:56:20 +01:00
|
|
|
salt.masterless = false
|
2017-02-18 13:29:18 +01:00
|
|
|
salt.minion_id = "salt"
|
2020-03-04 13:56:20 +01:00
|
|
|
salt.run_highstate = false
|
|
|
|
salt.minion_key = "salt/keys/salt.pem"
|
|
|
|
salt.minion_pub = "salt/keys/salt.pub"
|
|
|
|
salt.seed_master = {
|
|
|
|
dns: "salt/keys/dns.pub",
|
|
|
|
file: "salt/keys/file.pub",
|
|
|
|
ldap: "salt/keys/ldap.pub",
|
|
|
|
mail: "salt/keys/mail.pub",
|
|
|
|
mq: "salt/keys/mq.pub",
|
|
|
|
mysql: "salt/keys/mysql.pub",
|
|
|
|
pgsql: "salt/keys/pgsql.pub",
|
|
|
|
salt: "salt/keys/salt.pub",
|
|
|
|
service: "salt/keys/service.pub",
|
|
|
|
syslog: "salt/keys/syslog.pub",
|
|
|
|
web: "salt/keys/web.pub",
|
|
|
|
}
|
2017-02-18 13:29:18 +01:00
|
|
|
end
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "mq" do |node|
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.hostname = "mq"
|
2017-02-17 23:00:27 +01:00
|
|
|
node.vm.network "private_network", ip: "172.16.4.20"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/mq"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "mq"
|
|
|
|
salt.minion_key = "salt/keys/mq.pem"
|
|
|
|
salt.minion_pub = "salt/keys/mq.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "syslog" do |node|
|
|
|
|
node.vm.hostname = "syslog"
|
|
|
|
node.vm.network "private_network", ip: "172.16.4.30"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/syslog"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "syslog"
|
|
|
|
salt.minion_key = "salt/keys/syslog.pem"
|
|
|
|
salt.minion_pub = "salt/keys/syslog.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "pgsql" do |node|
|
|
|
|
node.vm.hostname = "pgsql"
|
2020-03-04 13:56:20 +01:00
|
|
|
#node.vm.synced_folder "repos/gvapgsql", "/srv/gvapgsql"
|
2017-02-17 23:00:27 +01:00
|
|
|
node.vm.network "private_network", ip: "172.16.4.40"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/pgsql"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "pgsql"
|
|
|
|
salt.minion_key = "salt/keys/pgsql.pem"
|
|
|
|
salt.minion_pub = "salt/keys/pgsql.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "dns" do |node|
|
|
|
|
node.vm.hostname = "dns"
|
|
|
|
node.vm.network "private_network", ip: "172.16.4.50"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/dns"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "dns"
|
|
|
|
salt.minion_key = "salt/keys/dns.pem"
|
|
|
|
salt.minion_pub = "salt/keys/dns.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "ldap" do |node|
|
|
|
|
node.vm.hostname = "ldap"
|
2020-03-04 13:56:20 +01:00
|
|
|
#node.vm.synced_folder "repos/gvaldap", "/srv/gvaldap"
|
2017-02-17 23:00:27 +01:00
|
|
|
node.vm.network "private_network", ip: "172.16.4.60"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/ldap"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "ldap"
|
|
|
|
salt.minion_key = "salt/keys/ldap.pem"
|
|
|
|
salt.minion_pub = "salt/keys/ldap.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "file" do |node|
|
|
|
|
node.vm.hostname = "file"
|
2020-03-04 13:56:20 +01:00
|
|
|
#node.vm.synced_folder "repos/gvafile", "/srv/gvafile"
|
2017-02-17 23:00:27 +01:00
|
|
|
node.vm.network "private_network", ip: "172.16.4.70"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/file"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "file"
|
|
|
|
salt.minion_key = "salt/keys/file.pem"
|
|
|
|
salt.minion_pub = "salt/keys/file.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "mail" do |node|
|
|
|
|
node.vm.hostname = "mail"
|
|
|
|
node.vm.network "private_network", ip: "172.16.4.80"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/mail"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "mail"
|
|
|
|
salt.minion_key = "salt/keys/mail.pem"
|
|
|
|
salt.minion_pub = "salt/keys/mail.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
|
2017-02-17 23:00:27 +01:00
|
|
|
config.vm.define "mysql" do |node|
|
|
|
|
node.vm.hostname = "mysql"
|
2020-03-04 13:56:20 +01:00
|
|
|
#node.vm.synced_folder "repos/gvamysql", "/srv/gvamysql"
|
2017-02-17 23:00:27 +01:00
|
|
|
node.vm.network "private_network", ip: "172.16.4.90"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/mysql"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "mysql"
|
|
|
|
salt.minion_key = "salt/keys/mysql.pem"
|
|
|
|
salt.minion_pub = "salt/keys/mysql.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.define "web" do |node|
|
|
|
|
node.vm.hostname = "web"
|
2020-03-04 13:56:20 +01:00
|
|
|
#node.vm.synced_folder "repos/gvaweb", "/srv/gvaweb"
|
2017-02-17 23:00:27 +01:00
|
|
|
node.vm.network "private_network", ip: "172.16.4.100"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/web"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "web"
|
|
|
|
salt.minion_key = "salt/keys/web.pem"
|
|
|
|
salt.minion_pub = "salt/keys/web.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
config.vm.define "service" do |node|
|
|
|
|
node.vm.hostname = "service"
|
2020-03-04 13:56:20 +01:00
|
|
|
#node.vm.synced_folder "repos/gva", "/srv/gva"
|
2017-02-17 23:00:27 +01:00
|
|
|
node.vm.network "forwarded_port", guest: 443, host:8443
|
|
|
|
node.vm.network "private_network", ip: "172.16.4.110"
|
|
|
|
node.vm.post_up_message = "Use https://localhost:8443/ to access the gva web interface"
|
2020-03-04 13:56:20 +01:00
|
|
|
node.vm.provider :libvirt do |libvirt|
|
|
|
|
libvirt.memory = 1024
|
|
|
|
end
|
|
|
|
|
|
|
|
node.vm.provision :salt do |salt|
|
|
|
|
salt.bootstrap_options = "-x python3"
|
|
|
|
salt.grains_config = "salt/grains/service"
|
|
|
|
salt.masterless = false
|
|
|
|
salt.minion_id = "service"
|
|
|
|
salt.minion_key = "salt/keys/service.pem"
|
|
|
|
salt.minion_pub = "salt/keys/service.pub"
|
|
|
|
salt.run_highstate = false
|
2017-02-17 23:00:27 +01:00
|
|
|
end
|
|
|
|
end
|
2017-02-17 21:30:58 +01:00
|
|
|
end
|