Files
debian/user-data
Sjaak van den Berg a75db3d264 20251216T004850CET
2025-12-16 00:48:50 +01:00

45 lines
1.1 KiB
Plaintext

#cloud-config
users:
- name: ghost
gecos: ghost
primary_group: ghost
groups: [users, sudo]
shell: /bin/bash
sudo: "ALL=(ALL) NOPASSWD:ALL"
ssh_authorized_keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHpi1yQ9KZWw6dIiYMkWdqTCgcP/4/s4wu8GWe3toIrz mail@svdb.co"
ssh_pwauth: true
hostname: debian
package_reboot_if_required: true
package_update: true
package_upgrade: true
packages:
- pwgen
- git
ansible:
package_name: ansible-core
install_method: pip
# run_user: ghost
pull:
accept_host_key: true
url: https://git.svdb.dev/svdb/debian.git
playbook_name: provision.yml
runcmd:
- ps -u ghost
- deluser --remove-all-files linuxuser
- usermod --uid 1000 ghost
- groupmod --gid 1000 ghost
- git clone https://git.svdb.dev/svdb/debian.git /tmp/debian
- bash /tmp/debian/install-uv.sh
- uv init --directory /tmp/debian
- uv add --directory /tmp/debian ansible-core==2.20.1
- uv run --directory /tmp/debian -- ansible-galaxy collection install -r requirements.yml
- uv run --directory /tmp/debian -- ansible-playbook /tmp/debian/provision.yml
- uv cache clean
- rm --recursive --force $(uv python dir)
- rm --recursive --force $(uv tool dir)