mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-opentofu-private.git
synced 2025-10-27 15:53:06 +00:00
Merge pull request 'Update proxmox.tf' (#121) from fenix-admin into main
Reviewed-on: fenix-gitea-admin/iac-teste#121
This commit is contained in:
26
proxmox.tf
26
proxmox.tf
@ -24,29 +24,37 @@ resource "proxmox_virtual_environment_download_file" "latest_ubunto_cloud_img" {
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_file" "cloud_init_yaml" {
|
||||
node_name = "fenix"
|
||||
datastore_id = "local"
|
||||
content_type = "snippets"
|
||||
datastore_id = "local"
|
||||
node_name = var.virtual_environment_node_name
|
||||
|
||||
source_raw {
|
||||
file_name = "cloud-init-qga.yaml"
|
||||
data = <<EOF
|
||||
data = <<-EOF
|
||||
#cloud-config
|
||||
hostname: test-ubuntu
|
||||
timezone: America/Toronto
|
||||
users:
|
||||
- default
|
||||
- name: testeuser
|
||||
plain_text_passwd: testepassword
|
||||
lock_passwd: false
|
||||
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
|
||||
|
||||
ssh_pwauth: true
|
||||
- echo "done" > /tmp/cloud-config.done
|
||||
EOF
|
||||
|
||||
file_name = "user-data-cloud-config.yaml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user