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" {
|
resource "proxmox_virtual_environment_file" "cloud_init_yaml" {
|
||||||
node_name = "fenix"
|
|
||||||
datastore_id = "local"
|
|
||||||
content_type = "snippets"
|
content_type = "snippets"
|
||||||
|
datastore_id = "local"
|
||||||
|
node_name = var.virtual_environment_node_name
|
||||||
|
|
||||||
source_raw {
|
source_raw {
|
||||||
file_name = "cloud-init-qga.yaml"
|
data = <<-EOF
|
||||||
data = <<EOF
|
|
||||||
#cloud-config
|
#cloud-config
|
||||||
|
hostname: test-ubuntu
|
||||||
|
timezone: America/Toronto
|
||||||
users:
|
users:
|
||||||
|
- default
|
||||||
- name: testeuser
|
- name: testeuser
|
||||||
plain_text_passwd: testepassword
|
plain_text_passwd: testepassword
|
||||||
lock_passwd: false
|
groups:
|
||||||
|
- sudo
|
||||||
shell: /bin/bash
|
shell: /bin/bash
|
||||||
|
ssh_authorized_keys:
|
||||||
|
- ${trimspace(data.local_file.ssh_public_key.content)}
|
||||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||||
|
package_update: true
|
||||||
packages:
|
packages:
|
||||||
- qemu-guest-agent
|
- qemu-guest-agent
|
||||||
|
- net-tools
|
||||||
|
- curl
|
||||||
runcmd:
|
runcmd:
|
||||||
- systemctl enable qemu-guest-agent
|
- systemctl enable qemu-guest-agent
|
||||||
- systemctl start qemu-guest-agent
|
- systemctl start qemu-guest-agent
|
||||||
|
- echo "done" > /tmp/cloud-config.done
|
||||||
ssh_pwauth: true
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
file_name = "user-data-cloud-config.yaml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user