-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-userdata.yaml
More file actions
56 lines (46 loc) Β· 2.8 KB
/
test-userdata.yaml
File metadata and controls
56 lines (46 loc) Β· 2.8 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
ssh_authorized_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFAJEwbe8ZuresTTfBGXSmpFKDcAkd6584qaA3y/3uVQ yebyen@Kingdons-MacBook-Pro-2.local
write_files:
- path: /opt/boot-to-talos.sh
permissions: '0755'
content: |
#!/bin/bash
set -euo pipefail
echo "π Starting boot-to-Talos transition..." | tee -a /var/log/boot-to-talos.log
# Install Docker for image operations
apt-get update | tee -a /var/log/boot-to-talos.log
apt-get install -y docker.io | tee -a /var/log/boot-to-talos.log
systemctl start docker | tee -a /var/log/boot-to-talos.log
# Configure Docker to use registry caches
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << DOCKER_EOF
{
"registry-mirrors": ["http://10.10.1.100:5054"],
"insecure-registries": ["10.10.1.100:5054"]
}
DOCKER_EOF
systemctl restart docker | tee -a /var/log/boot-to-talos.log
# Test registry connectivity
echo "π¦ Testing registry cache connectivity..." | tee -a /var/log/boot-to-talos.log
echo "π Testing ping to bastion..." | tee -a /var/log/boot-to-talos.log
ping -c 3 10.10.1.100 2>&1 | tee -a /var/log/boot-to-talos.log
curl -v http://10.10.1.100:5054/v2/ 2>&1 | tee -a /var/log/boot-to-talos.log || true
# Pull custom Talos image via registry cache
echo "π Pulling: ghcr.io/urmanac/cozystack-assets/talos/cozystack-spin-tailscale/talos:latest" | tee -a /var/log/boot-to-talos.log
# Use registry cache path since nodes have no direct internet
docker pull 10.10.1.100:5054/urmanac/cozystack-assets/talos/cozystack-spin-tailscale/talos:latest 2>&1 | tee -a /var/log/boot-to-talos.log || true
# Tag for reference
docker tag 10.10.1.100:5054/urmanac/cozystack-assets/talos/cozystack-spin-tailscale/talos:latest ghcr.io/urmanac/cozystack-assets/talos/cozystack-spin-tailscale/talos:latest 2>&1 | tee -a /var/log/boot-to-talos.log || true
# List what we got
docker images | tee -a /var/log/boot-to-talos.log
# Now actually boot to Talos!
echo "π Downloading boot-to-talos via IPv6..." | tee -a /var/log/boot-to-talos.log
wget -6 http://[2620:8d:8000:e49:a00:27ff:fe2f:b6d9]/boot-to-talos -O /tmp/boot-to-talos 2>&1 | tee -a /var/log/boot-to-talos.log
chmod +x /tmp/boot-to-talos 2>&1 | tee -a /var/log/boot-to-talos.log
echo "π Running boot-to-talos in install mode..." | tee -a /var/log/boot-to-talos.log
/tmp/boot-to-talos -mode install -yes -disk /dev/nvme0n1 -image ghcr.io/urmanac/cozystack-assets/talos/cozystack-spin-tailscale/talos:latest -image-size-gib 8 -extra-kernel-arg "console=ttyS0" 2>&1 | tee -a /var/log/boot-to-talos.log
echo "Boot-to-Talos test complete" | tee -a /var/log/boot-to-talos.log
runcmd:
- /opt/boot-to-talos.sh
final_message: "Ubuntu β Talos transition test initiated"