This repository has been archived on 2024-07-30. You can view files and clone it, but cannot push or open issues or pull requests.
IaC-Homelab/cloud-init.tf
2024-06-24 17:36:44 -04:00

35 lines
No EOL
920 B
HCL

data "local_file" "ssh_public_key" {
filename = "/home/mafyuh/.ssh/main_key.pub"
}
resource "proxmox_virtual_environment_file" "cloud_config" {
content_type = "snippets"
datastore_id = "Slow4tb"
node_name = "prox"
source_raw {
data = <<-EOF
#cloud-config
users:
- default
- name: mafyuh
groups:
- sudo
- docker
shell: /bin/bash
ssh_authorized_keys:
- ${trimspace(data.local_file.ssh_public_key.content)}
sudo: ALL=(ALL) NOPASSWD:ALL
runcmd:
- apt update
- apt install -y qemu-guest-agent net-tools nfs-common
- timedatectl set-timezone America/New_York
- systemctl enable qemu-guest-agent
- systemctl start qemu-guest-agent
- curl -fsSL https://get.docker.com | sudo sh
- echo "done" > /tmp/cloud-config.done
EOF
file_name = "cloud-config.yaml"
}
}