-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
46 lines (39 loc) · 1.14 KB
/
Vagrantfile
File metadata and controls
46 lines (39 loc) · 1.14 KB
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
FORMULA_SETUP = <<-'SHELL'
set -e
# Install Salt (bootstrap script handles both Debian and RedHat)
if ! command -v salt-call &>/dev/null; then
curl -fsSL https://bootstrap.saltproject.io | bash -s -- -X
fi
# Wire up file and pillar roots
mkdir -p /srv/salt /srv/pillar
ln -sfn /srv/formula/users /srv/salt/users
cp -f /srv/formula/top.sls /srv/salt/top.sls
cp -rf /srv/formula/tests/pillar/. /srv/pillar/
mkdir -p /etc/salt/minion.d
cat > /etc/salt/minion.d/formula.conf << 'EOF'
file_roots:
base:
- /srv/salt
- /srv/formula
pillar_roots:
base:
- /srv/pillar
EOF
salt-call --local state.apply
SHELL
Vagrant.configure("2") do |config|
config.vm.define "ubuntu" do |node|
node.vm.box = "ubuntu/bionic64"
node.vm.hostname = "minion-ubuntu"
node.vm.synced_folder ".", "/srv/formula"
node.vm.provision "shell", inline: FORMULA_SETUP
end
config.vm.define "centos" do |node|
node.vm.box = "centos/7"
node.vm.hostname = "minion-centos"
node.vm.synced_folder ".", "/srv/formula"
node.vm.provision "shell", inline: FORMULA_SETUP
end
end