-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
43 lines (40 loc) · 1.34 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
# This file is part of termpong.
#
# Copyright (c) 2019 Andrew Steel <copyright@andrewsteel.net>
#
# SPDX-License-Identifier: GPL-3.0-only
#
# The GNU General Public License Version 3 only:
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License Version 3
# as published by the Free Software Foundation.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this file. If not, see <https://www.gnu.org/licenses/>.
Vagrant.configure("2") do |config|
config.vm.box = "generic/debian9"
config.vm.hostname = "vm-termpong"
config.vm.post_up_message = $post_up_message
config.vm.provision "shell",
inline: $provision_shell_inline_always,
run: "always"
config.vm.synced_folder ".", "/shared"
end
$post_up_message = <<-'EOF'
Machine is ready, run `vagrant ssh` to enter.
Shared directory is available at `~/termpong`.
EOF
$provision_shell_inline_always = <<-'EOF'
#!/bin/sh
# Create shared directory in "${HOME}/termpong".
sudo -u 'vagrant' sh -c '
rm -f "${HOME}/termpong"
ln -s "/shared" "${HOME}/termpong"
'
EOF