-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphantom-server.yaml
More file actions
56 lines (50 loc) · 1.73 KB
/
phantom-server.yaml
File metadata and controls
56 lines (50 loc) · 1.73 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
#cloud-config
#
# Phantom Linux server first-boot provisioning.
#
# Replace `dev-user` with the login user that should own the graphical session.
# This intentionally uses the release installer instead of cloning the repo:
# cloud-init prepares the OS/display state, then Phantom's installer verifies it
# with `--doctor`.
package_update: true
packages:
- ca-certificates
- curl
- sudo
write_files:
- path: /usr/local/sbin/phantom-firstboot-doctor.sh
owner: root:root
permissions: "0755"
content: |
#!/bin/sh
set -eu
for i in $(seq 1 30); do
if /usr/local/share/phantom/install.sh --doctor --doctor-strict --user=dev-user; then
exit 0
fi
echo "phantom doctor not ready yet; retry $i/30"
sleep 10
done
exit 1
- path: /etc/systemd/system/phantom-firstboot-doctor.service
owner: root:root
permissions: "0644"
content: |
[Unit]
Description=Validate Phantom remote desktop readiness after first reboot
Wants=network-online.target graphical.target
After=network-online.target graphical.target display-manager.service
[Service]
Type=oneshot
TimeoutStartSec=6min
ExecStart=/usr/local/sbin/phantom-firstboot-doctor.sh
ExecStartPost=/bin/systemctl disable phantom-firstboot-doctor.service
[Install]
WantedBy=graphical.target
runcmd:
- mkdir -p /usr/local/share/phantom
- curl -fsSL https://raw.githubusercontent.com/huaying/phantom/main/install.sh -o /usr/local/share/phantom/install.sh
- chmod +x /usr/local/share/phantom/install.sh
- /usr/local/share/phantom/install.sh server --autologin --install-mode=auto --user=dev-user
- systemctl enable phantom-firstboot-doctor.service
- reboot