-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
124 lines (103 loc) · 4.17 KB
/
Copy pathVagrantfile
File metadata and controls
124 lines (103 loc) · 4.17 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
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
BRIDGE_DEV = ENV.fetch("GREETDEEZ_VM_BRIDGE", "br0")
USE_BRIDGE = system("ip link show #{BRIDGE_DEV} > /dev/null 2>&1")
Vagrant.configure("2") do |config|
config.ssh.pty = true
# Provisioning is inline
config.vm.synced_folder ".", "/vagrant", disabled: true
if USE_BRIDGE
config.vm.network :public_network, dev: BRIDGE_DEV, mode: "bridge", type: "bridge"
end
config.vm.provider :libvirt do |lv|
lv.memory = 4096
lv.cpus = 2
lv.graphics_type = "spice"
lv.video_type = "qxl"
lv.video_vram = 262144
lv.channel :type => 'spicevmc', :target_name => 'com.redhat.spice.0', :target_type => 'virtio'
lv.management_network_mode = "none" if USE_BRIDGE
end
create_test_user = <<~SHELL
id test &>/dev/null || useradd -m -s /bin/bash test
echo 'test:test' | chpasswd
echo 'test ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/test
SHELL
# --- Arch Linux ---
config.vm.define "arch", autostart: false do |arch|
arch.vm.box = "generic/arch"
arch.vm.hostname = "greetdeez-arch"
arch.vm.provision "base", type: "shell", inline: <<~SHELL
set -e
echo 'nameserver 1.1.1.1' > /etc/resolv.conf
# The box ships a stale mirrorlist full of dead mirrors; pin good ones.
printf '%s\\n' \
'Server = https://geo.mirror.pkgbuild.com/$repo/os/$arch' \
'Server = https://mirror.rackspace.com/archlinux/$repo/os/$arch' \
> /etc/pacman.d/mirrorlist
pacman -Sy --noconfirm archlinux-keyring
pacman -Syu --noconfirm
pacman -S --noconfirm --needed sway gnome-shell gnome-session xorg-server plasma-desktop konsole foot base-devel git spice-vdagent
systemctl enable spice-vdagentd
#{create_test_user}
su - test -c '
rm -rf /tmp/yay
git clone https://aur.archlinux.org/yay.git /tmp/yay
cd /tmp/yay
makepkg -si --noconfirm
'
SHELL
arch.vm.provision "package", type: "shell", run: "never", reboot: true, inline: <<~SHELL
su - test -c 'yay -S --noconfirm greetdeez-bin'
#echo 'GREETDEEZ_DEBUG=1' >> /etc/environment
SHELL
end
# --- Debian ---
config.vm.define "debian", autostart: false do |deb|
deb.vm.box = "debian/bookworm64"
deb.vm.hostname = "greetdeez-debian"
deb.vm.provision "base", type: "shell", inline: <<~SHELL
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y curl sway gnome-shell gnome-session plasma-desktop konsole foot xorg spice-vdagent
systemctl enable spice-vdagentd
#{create_test_user}
SHELL
deb.vm.provision "package", type: "shell", run: "never", reboot: true, inline: <<~SHELL
curl -1sLf 'https://dl.cloudsmith.io/public/nickheyer/greetdeez/setup.deb.sh' | bash
apt-get install -y greetdeez
#echo 'GREETDEEZ_DEBUG=1' >> /etc/environment
SHELL
end
# --- Fedora ---
config.vm.define "fedora", autostart: false do |fed|
fed.vm.box = "fedora/41-cloud-base"
fed.vm.hostname = "greetdeez-fedora"
fed.vm.provision "base", type: "shell", inline: <<~SHELL
dnf install -y sway gnome-shell gnome-session plasma-desktop konsole foot @base-x spice-vdagent
systemctl enable spice-vdagentd
#{create_test_user}
SHELL
fed.vm.provision "package", type: "shell", run: "never", reboot: true, inline: <<~SHELL
curl -1sLf 'https://dl.cloudsmith.io/public/nickheyer/greetdeez/setup.rpm.sh' | bash
dnf install -y greetdeez
#echo 'GREETDEEZ_DEBUG=1' >> /etc/environment
SHELL
end
# --- Alpine ---
config.vm.define "alpine", autostart: false do |alp|
alp.vm.box = "generic/alpine319"
alp.vm.hostname = "greetdeez-alpine"
alp.vm.provision "base", type: "shell", inline: <<~SHELL
apk update
apk add sway gnome-shell gnome-session plasma-desktop konsole foot xorg-server spice-vdagent
rc-update add spice-vdagentd default
#{create_test_user}
SHELL
alp.vm.provision "package", type: "shell", run: "never", reboot: true, inline: <<~SHELL
curl -1sLf 'https://dl.cloudsmith.io/public/nickheyer/greetdeez/setup.alpine.sh' | bash
apk add greetdeez
#echo 'GREETDEEZ_DEBUG=1' >> /etc/environment
SHELL
end
end