Add Cloud-Init automation with Tailscale
The commit rephrases the README to focus on Cloud-Init setup and removes unused Ansible code, making Tailscale configuration automatic. Subject line: Replace Ansible with automated Cloud-Init configuration Body: Refactors infrastructure bootstrapping to leverage Cloud-Init instead of Ansible for initial VM setup, particularly with respect to Tailscale installation and authentication. This simplifies the architecture by: - Removing manual post-provisioning Ansible steps - Automating Tailscale setup via Cloud-Init - Updating documentation to reflect new workflow
This commit is contained in:
29
cloud-init/user-data.yml.tftpl
Normal file
29
cloud-init/user-data.yml.tftpl
Normal file
@@ -0,0 +1,29 @@
|
||||
#cloud-config
|
||||
|
||||
# 1. Configuration du nom d'hôte de la machine
|
||||
hostname: ${hostname}
|
||||
fqdn: ${hostname}
|
||||
preserve_hostname: false
|
||||
|
||||
# 2. Création de l'utilisateur
|
||||
users:
|
||||
- name: ${username}
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
groups: sudo, admin
|
||||
shell: /bin/bash
|
||||
ssh_authorized_keys:
|
||||
- ${ssh_key}
|
||||
|
||||
# 3. Mise à jour du système
|
||||
package_update: true
|
||||
package_upgrade: true
|
||||
|
||||
# 4. Installation des paquets
|
||||
packages:
|
||||
- qemu-guest-agent
|
||||
- curl
|
||||
|
||||
# 5. Installation et configuration de Tailscale
|
||||
runcmd:
|
||||
- [ 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