Add Alpine and systemd cloud-init templates
This commit is contained in:
32
cloud-init/user-data-systemd.yml.tftpl
Normal file
32
cloud-init/user-data-systemd.yml.tftpl
Normal file
@@ -0,0 +1,32 @@
|
||||
#cloud-config
|
||||
|
||||
# 1. Hostname configuration
|
||||
hostname: ${hostname}
|
||||
fqdn: ${hostname}
|
||||
preserve_hostname: false
|
||||
|
||||
# 2. User creation
|
||||
users:
|
||||
- name: ${username}
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
groups: sudo, admin
|
||||
shell: /bin/bash
|
||||
ssh_authorized_keys:
|
||||
- ${ssh_key}
|
||||
|
||||
# 3. System update
|
||||
package_update: true
|
||||
package_upgrade: true
|
||||
|
||||
# 4. Package installation
|
||||
packages:
|
||||
- qemu-guest-agent
|
||||
- curl
|
||||
|
||||
# 5. Tailscale installation and configuration
|
||||
runcmd:
|
||||
# Enable and start qemu-guest-agent (systemd)
|
||||
- [ systemctl, enable, qemu-guest-agent, --now ]
|
||||
# Install and configure Tailscale
|
||||
- [ sh, -c, "curl -fsSL https://tailscale.com/install.sh | sh" ]
|
||||
- [ tailscale, up, --authkey=${tailscale_auth_key}, --hostname=${vm_name} ]
|
||||
Reference in New Issue
Block a user