-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
130 lines (102 loc) · 4.02 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# MASTER SERVER
config.vm.define "master" do |master|
# Define the hostname of the machine
master.vm.hostname = "master"
# Use Ubuntus box
master.vm.box = "ubuntu/trusty64"
# Network configuration
master.vm.network "private_network", ip: "192.168.100.100"
# Forward port 80 to 8080 for production
master.vm.network "forwarded_port", guest: 80, host: 8080
# Forward port 5000 for debug
master.vm.network "forwarded_port", guest: 5000, host: 5000
master.ssh.forward_agent = true
# Sync project directory
master.vm.synced_folder ".", "/vagrant"
master.vm.synced_folder ".", "/opt/kidsakoder-minecraft"
# Salt directories
master.vm.synced_folder "saltstack/salt", "/srv/salt"
master.vm.synced_folder "saltstack/pillar", "/srv/pillar"
master.vm.synced_folder "saltstack/reactor", "/srv/reactor"
# Salt provisioning
master.vm.provision "salt" do |salt|
# Salt install configuration
salt.install_master = true
# Use stable Salt version 2015.8
salt.install_type = "stable"
salt.install_args = "2015.8"
# Salt master configuration
salt.master_config = "saltstack/etc/master.conf"
# Grain that sets special settings for Vagrant development.
# See grains file and saltstack/salt/top.sls for more info.
salt.grains_config = "saltstack/vagrant/grains/master"
# Minion config
salt.minion_config = "saltstack/etc/master_minion.conf"
# Define keys for master and mc machines
salt.master_key = "saltstack/vagrant/keys/master.pem"
salt.master_pub = "saltstack/vagrant/keys/master.pub"
salt.minion_key = "saltstack/vagrant/keys/master.pem"
salt.minion_pub = "saltstack/vagrant/keys/master.pub"
salt.seed_master = {
master: "saltstack/vagrant/keys/master.pub",
mc: "saltstack/vagrant/keys/minion.pub"
}
# Apply states on start
salt.run_highstate = true
salt.colorize = true
# Enable for debugging
# salt.verbose = true
# salt.log_level = "warning"
end
# Virtualbox settings
master.vm.provider "virtualbox" do |v|
v.memory = 1024
end
# Post message
master.vm.post_up_message = "The Salt master and web server is up and running.\n" \
"Use http://localhost:8080 for port 80.\n" \
"Use http://localhost:5000 for port 5000.\n"
end
# MINECRAFT SERVER
config.vm.define "mc" do |minion|
# Define the hostname of the machine
minion.vm.hostname = "mc"
# Use Ubuntus box
minion.vm.box = "ubuntu/trusty64"
# Network configuration
minion.vm.network "private_network", ip: "192.168.100.101"
# Forward port 25565 for Minecraft
minion.vm.network "forwarded_port", guest: 25565, host: 25565
# Salt provisioning
minion.vm.provision "salt" do |salt|
# Use stable Salt version 2015.8
salt.install_type = "stable"
salt.install_args = "2015.8"
# Grain that defines this to be a Minecraft server.
# See grains file and saltstack/salt/top.sls for more info.
salt.grains_config = "saltstack/vagrant/grains/mc"
# Minion config
salt.minion_config = "saltstack/vagrant/minion.conf"
# Minion keys
salt.minion_key = "saltstack/vagrant/keys/minion.pem"
salt.minion_pub = "saltstack/vagrant/keys/minion.pub"
# Apply states on start
salt.run_highstate = true
salt.colorize = true
# Enable for debugging
# salt.verbose = true
# salt.log_level = "warning"
end
# Virtualbox settings
minion.vm.provider "virtualbox" do |v|
v.memory = 1024
end
# Post message
minion.vm.post_up_message = "The Minecraft Forge server is up and running.\n" \
"See saltstack/vagrant/grains/mc for which versions of Forge and ComputerCraft.\n" \
"Connect to localhost:25565 in Minecraft to play.\n"
end
end