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:
darnodo
2025-07-03 09:28:09 +02:00
parent 26d97cbcfb
commit 7cd93ba978
23 changed files with 119 additions and 797 deletions

View File

@@ -0,0 +1,26 @@
# Fichier: terraform/prod/02-cloud-init.tf
resource "proxmox_virtual_environment_file" "cloud_config" {
for_each = var.virtual_machines
node_name = var.target_node
datastore_id = "local"
content_type = "snippets"
source_raw {
data = templatefile("${path.module}/../../cloud-init/user-data.yml.tftpl", {
# Variables pour définir les informations de l'utilisateur
username = lookup(each.value, "username", var.default_vm_user)
ssh_key = file(var.admin_ssh_public_key_path)
# Variables pour définir les informations de la VM
hostname = "${each.key}.${var.domain_suffix}"
# Nouvelles variables pour Tailscale
vm_name = each.key # Le nom de la VM (ex: "web-01")
tailscale_auth_key = var.tailscale_auth_key
})
file_name = "${each.key}-cloud-init.yml"
}
}