endlager/opensuse-salt-formulas/Vagrantfile-Master
Georg Pfuetzenreuter 3bec65fae2
Dump early Scullery works
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2023-05-20 15:18:55 +02:00

38 lines
1.4 KiB
Ruby

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.provider "libvirt"
config.vm.box = "tumbleweed-salt"
config.vm.box_url = "https://download.opensuse.org/repositories/home:/crameleon:/appliances/openSUSE_Tumbleweed/Tumbleweed.x86_64-libvirt.box"
config.vm.provision "shell", inline: <<-SHELL
# for some reason, Avahi DNS doesn't work until the network stack is restarted
rcnetwork restart
SHELL
config.vm.define "master", primary: true do |master_config|
master_config.vm.hostname = "salt-master"
master_config.vm.provider :libvirt do |libvirt|
libvirt.memory = 768
end
master_config.vm.provision "shell", path: "bootstrap-salt-roots.sh"
master_config.vm.provision "shell", inline: <<-SHELL
printf 'auto_accept: True\n' > /etc/salt/master.d/notsecure.conf
printf 'file_roots:\n base:\n - /srv/salt\n - /srv/formulas\n' > /etc/salt/master.d/roots.conf
systemctl enable --now salt-master
SHELL
end
[
"minion1",
"minion2",
].each do |vmname|
config.vm.define "#{vmname}" do |minion_config|
minion_config.vm.synced_folder '.', '/vagrant', disabled: true
minion_config.vm.hostname = "salt-#{vmname}"
minion_config.vm.provision "shell", inline: <<-SHELL
sed -i 's/^#master:.*/master: salt-master/' /etc/salt/minion
systemctl enable --now salt-minion
SHELL
end
end
end