PoC OpenTofu configuration works
This commit is contained in:
37
cloud-conf.tf
Normal file
37
cloud-conf.tf
Normal file
@@ -0,0 +1,37 @@
|
||||
data "local_file" "ssh_public_key" {
|
||||
filename = "./id_ed25519_rocky.pub"
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_file" "user_data_cloud_config" {
|
||||
content_type = "snippets"
|
||||
datastore_id = "local"
|
||||
node_name = var.virtual_environment_node_name
|
||||
|
||||
source_raw {
|
||||
data = <<-EOF
|
||||
#cloud-config
|
||||
hostname: test-ubuntu
|
||||
timezone: Europe/Berlin
|
||||
users:
|
||||
- default
|
||||
- name: ubuntu
|
||||
groups:
|
||||
- sudo
|
||||
shell: /bin/bash
|
||||
ssh_authorized_keys:
|
||||
- ${trimspace(data.local_file.ssh_public_key.content)}
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
package_update: true
|
||||
packages:
|
||||
- qemu-guest-agent
|
||||
- net-tools
|
||||
- curl
|
||||
runcmd:
|
||||
- systemctl enable qemu-guest-agent
|
||||
- systemctl start qemu-guest-agent
|
||||
- echo "done" > /tmp/cloud-config.done
|
||||
EOF
|
||||
|
||||
file_name = "user-data-cloud-config.yaml"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user