diff --git a/clone-rocky.tf b/clone-rocky.tf index 393ef05..860ef4c 100644 --- a/clone-rocky.tf +++ b/clone-rocky.tf @@ -17,7 +17,7 @@ resource "proxmox_virtual_environment_vm" "rocky_clone" { } memory { - dedicated = 768 + dedicated = 2048 } initialization { @@ -38,4 +38,46 @@ resource "proxmox_virtual_environment_vm" "rocky_clone" { output "rocky_ipv4_address" { value = proxmox_virtual_environment_vm.rocky_clone.ipv4_addresses[1][0] +} + +resource "proxmox_virtual_environment_vm" "project-tomorrow" { + name = "project-tomorrow" + node_name = var.virtual_environment_node_name + started = true + + clone { + vm_id = "7000" + } + + agent { + # NOTE: The agent is installed and enabled as part of the cloud-init configuration in the template VM, see cloud-config.tf + # The working agent is *required* to retrieve the VM IP addresses. + # If you are using a different cloud-init configuration, or a different clone source + # that does not have the qemu-guest-agent installed, you may need to disable the `agent` below and remove the `vm_ipv4_address` output. + # See https://bpg.sh/docs/resources/virtual_environment_vm#qemu-guest-agent for more details. + enabled = true + } + + memory { + dedicated = 4048 + } + + initialization { + dns { + servers = ["1.1.1.1"] + } + ip_config { + ipv4 { + address = "dhcp" + } + } + user_account { + username = "rocky" + keys = [trimspace(file("./id_ed25519_pt.pub"))] + } + } +} + +output "project_tomorrow_ipv4_address" { + value = proxmox_virtual_environment_vm.project-tomorrow.ipv4_addresses[1][0] } \ No newline at end of file diff --git a/clone-ubuntu.tf b/clone-ubuntu.tf.bak similarity index 100% rename from clone-ubuntu.tf rename to clone-ubuntu.tf.bak diff --git a/terraform.tfstate b/terraform.tfstate index d8ba04b..e69de29 100644 --- a/terraform.tfstate +++ b/terraform.tfstate @@ -1,10 +0,0 @@ -{ - "version": 4, - "terraform_version": "1.12.1", - "serial": 21, - "lineage": "af0feed9-13f3-3cfd-a2e5-f720e7014b48", - "outputs": {}, - "resources": [], - "check_results": null -} - diff --git a/terraform.tfstate.backup b/terraform.tfstate.backup index 8347b69..a0ae285 100644 --- a/terraform.tfstate.backup +++ b/terraform.tfstate.backup @@ -1 +1 @@ -{"version":4,"terraform_version":"1.12.1","serial":20,"lineage":"af0feed9-13f3-3cfd-a2e5-f720e7014b48","outputs":{"rocky2_ipv4_address":{"value":"192.168.178.129","type":"string"},"rocky_ipv4_address":{"value":"192.168.178.128","type":"string"}},"resources":[{"mode":"data","type":"local_file","name":"ssh_public_key","provider":"provider[\"registry.opentofu.org/hashicorp/local\"]","instances":[{"schema_version":0,"attributes":{"content":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNzWdVP6bgpf+Edu9+r+mk+s4xpO2XkM4jOfCvJ2CKe rocky\n","content_base64":"c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUtOeldkVlA2YmdwZitFZHU5K3IrbWsrczR4cE8yWGtNNGpPZkN2SjJDS2Ugcm9ja3kK","content_base64sha256":"AgqOhmLC5TDeSq4+DmxrYp8Tsg2Uof0X6oI/feOHiW4=","content_base64sha512":"968lXZ4JGzTebdeZvQ6m7ZJ0h0ze7J66PT68S8Qu5bYC4ecODmMGVKBMgdvxMdFvn/qtO+uDdcgxz9jRUvrsiw==","content_md5":"e6741967eaea6f76daed9345a3108570","content_sha1":"02d2daf47d4b7a38c969c9936072cecb1d7af10b","content_sha256":"020a8e8662c2e530de4aae3e0e6c6b629f13b20d94a1fd17ea823f7de387896e","content_sha512":"f7af255d9e091b34de6dd799bd0ea6ed9274874cdeec9eba3d3ebc4bc42ee5b602e1e70e0e630654a04c81dbf131d16f9ffaad3beb8375c831cfd8d152faec8b","filename":"./id_ed25519_rocky.pub","id":"02d2daf47d4b7a38c969c9936072cecb1d7af10b"},"sensitive_attributes":[]}]},{"mode":"managed","type":"proxmox_virtual_environment_file","name":"user_data_cloud_config","provider":"provider[\"registry.opentofu.org/bpg/proxmox\"]","instances":[{"schema_version":0,"attributes":{"content_type":"snippets","datastore_id":"local","file_mode":null,"file_modification_date":null,"file_name":"user-data-cloud-config.yaml","file_size":null,"file_tag":null,"id":"local:snippets/user-data-cloud-config.yaml","node_name":"pve","overwrite":true,"source_file":[],"source_raw":[{"data":"#cloud-config\nhostname: test-ubuntu\ntimezone: Europe/Berlin\nusers:\n - default\n - name: ubuntu\n groups:\n - sudo\n shell: /bin/bash\n ssh_authorized_keys:\n - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNzWdVP6bgpf+Edu9+r+mk+s4xpO2XkM4jOfCvJ2CKe rocky\n sudo: ALL=(ALL) NOPASSWD:ALL\npackage_update: true\npackages:\n - qemu-guest-agent\n - net-tools\n - curl\nruncmd:\n - systemctl enable qemu-guest-agent\n - systemctl start qemu-guest-agent\n - echo \"done\" \u003e /tmp/cloud-config.done\n","file_name":"user-data-cloud-config.yaml","resize":0}],"timeout_upload":1800,"upload_mode":"stream"},"sensitive_attributes":[],"private":"bnVsbA==","dependencies":["data.local_file.ssh_public_key"]}]},{"mode":"managed","type":"proxmox_virtual_environment_vm","name":"rocky_clone","provider":"provider[\"registry.opentofu.org/bpg/proxmox\"]","instances":[{"schema_version":0,"attributes":{"acpi":true,"agent":[{"enabled":true,"timeout":"15m","trim":false,"type":"virtio","wait_for_ip":[]}],"amd_sev":[],"audio_device":[],"bios":"seabios","boot_order":["scsi0","net0"],"cdrom":[],"clone":[{"datastore_id":"","full":true,"node_name":"","retries":1,"vm_id":7000}],"cpu":[],"delete_unreferenced_disks_on_destroy":true,"description":null,"disk":[],"efi_disk":[],"hook_script_file_id":null,"hostpci":[],"hotplug":null,"id":"107","initialization":[{"datastore_id":"local-lvm","dns":[{"domain":"","servers":["1.1.1.1"]}],"file_format":"","interface":"ide0","ip_config":[{"ipv4":[{"address":"dhcp","gateway":""}],"ipv6":[]}],"meta_data_file_id":"","network_data_file_id":"","type":"","upgrade":true,"user_account":[{"keys":["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNzWdVP6bgpf+Edu9+r+mk+s4xpO2XkM4jOfCvJ2CKe rocky"],"password":"","username":"rocky"}],"user_data_file_id":"","vendor_data_file_id":""}],"ipv4_addresses":[["127.0.0.1"],["192.168.178.128"]],"ipv6_addresses":[["::1"],["fe80::be24:11ff:fe9e:d000"]],"keyboard_layout":"en-us","kvm_arguments":null,"mac_addresses":["00:00:00:00:00:00","BC:24:11:9E:D0:00"],"machine":null,"memory":[{"dedicated":768,"floating":0,"hugepages":"","keep_hugepages":false,"shared":0}],"migrate":false,"name":"rocky-clone","network_device":[{"bridge":"vmbr0","disconnected":false,"enabled":true,"firewall":false,"mac_address":"BC:24:11:9E:D0:00","model":"virtio","mtu":0,"queues":0,"rate_limit":0,"trunks":"","vlan_id":0}],"network_interface_names":["lo","eth0"],"node_name":"pve","numa":[],"on_boot":true,"operating_system":[],"pool_id":"","protection":false,"purge_on_destroy":true,"reboot":false,"reboot_after_update":true,"rng":[],"scsi_hardware":"virtio-scsi-pci","serial_device":[],"smbios":[],"started":true,"startup":[],"stop_on_destroy":false,"tablet_device":true,"tags":null,"template":false,"timeout_clone":1800,"timeout_create":1800,"timeout_migrate":1800,"timeout_move_disk":1800,"timeout_reboot":1800,"timeout_shutdown_vm":1800,"timeout_start_vm":1800,"timeout_stop_vm":300,"tpm_state":[],"usb":[],"vga":[],"virtiofs":[],"vm_id":107,"watchdog":[]},"sensitive_attributes":[[{"type":"get_attr","value":"initialization"},{"type":"index","value":{"value":0,"type":"number"}},{"type":"get_attr","value":"user_account"},{"type":"index","value":{"value":0,"type":"number"}},{"type":"get_attr","value":"password"}]],"private":"bnVsbA=="}]},{"mode":"managed","type":"proxmox_virtual_environment_vm","name":"rocky_clone_2","provider":"provider[\"registry.opentofu.org/bpg/proxmox\"]","instances":[{"schema_version":0,"attributes":{"acpi":true,"agent":[{"enabled":true,"timeout":"15m","trim":false,"type":"virtio","wait_for_ip":[]}],"amd_sev":[],"audio_device":[],"bios":"seabios","boot_order":["scsi0","net0"],"cdrom":[],"clone":[{"datastore_id":"","full":true,"node_name":"","retries":1,"vm_id":7000}],"cpu":[],"delete_unreferenced_disks_on_destroy":true,"description":null,"disk":[],"efi_disk":[],"hook_script_file_id":null,"hostpci":[],"hotplug":null,"id":"108","initialization":[{"datastore_id":"local-lvm","dns":[{"domain":"","servers":["1.1.1.1"]}],"file_format":"","interface":"ide0","ip_config":[{"ipv4":[{"address":"dhcp","gateway":""}],"ipv6":[]}],"meta_data_file_id":"","network_data_file_id":"","type":"","upgrade":true,"user_account":[{"keys":["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGu/jMracC6hJKxrudYOxne2ex2VL17tz7ehcB8KyB7n tofu@rpi4-20231108"],"password":"","username":"rocky"}],"user_data_file_id":"","vendor_data_file_id":""}],"ipv4_addresses":[["127.0.0.1"],["192.168.178.129"]],"ipv6_addresses":[["::1"],["fe80::be24:11ff:fe41:9f6e"]],"keyboard_layout":"en-us","kvm_arguments":null,"mac_addresses":["00:00:00:00:00:00","BC:24:11:41:9F:6E"],"machine":null,"memory":[{"dedicated":768,"floating":0,"hugepages":"","keep_hugepages":false,"shared":0}],"migrate":false,"name":"rocky-clone-2","network_device":[{"bridge":"vmbr0","disconnected":false,"enabled":true,"firewall":false,"mac_address":"BC:24:11:41:9F:6E","model":"virtio","mtu":0,"queues":0,"rate_limit":0,"trunks":"","vlan_id":0}],"network_interface_names":["lo","eth0"],"node_name":"pve","numa":[],"on_boot":true,"operating_system":[],"pool_id":"","protection":false,"purge_on_destroy":true,"reboot":false,"reboot_after_update":true,"rng":[],"scsi_hardware":"virtio-scsi-pci","serial_device":[],"smbios":[],"started":true,"startup":[],"stop_on_destroy":false,"tablet_device":true,"tags":null,"template":false,"timeout_clone":1800,"timeout_create":1800,"timeout_migrate":1800,"timeout_move_disk":1800,"timeout_reboot":1800,"timeout_shutdown_vm":1800,"timeout_start_vm":1800,"timeout_stop_vm":300,"tpm_state":[],"usb":[],"vga":[],"virtiofs":[],"vm_id":108,"watchdog":[]},"sensitive_attributes":[[{"type":"get_attr","value":"initialization"},{"type":"index","value":{"value":0,"type":"number"}},{"type":"get_attr","value":"user_account"},{"type":"index","value":{"value":0,"type":"number"}},{"type":"get_attr","value":"password"}]],"private":"bnVsbA=="}]},{"mode":"managed","type":"proxmox_virtual_environment_vm","name":"ubuntu_template","provider":"provider[\"registry.opentofu.org/bpg/proxmox\"]","instances":[{"schema_version":0,"attributes":{"acpi":true,"agent":[],"amd_sev":[],"audio_device":[],"bios":"ovmf","boot_order":["virtio0","net0"],"cdrom":[],"clone":[],"cpu":[{"affinity":"","architecture":"","cores":2,"flags":[],"hotplugged":0,"limit":0,"numa":false,"sockets":1,"type":"qemu64","units":0}],"delete_unreferenced_disks_on_destroy":true,"description":"Managed by OpenTofu","disk":[{"aio":"io_uring","backup":true,"cache":"none","datastore_id":"local-lvm","discard":"on","file_format":"raw","file_id":"local:iso/jammy-server-cloudimg-amd64.img","import_from":"","interface":"virtio0","iothread":true,"path_in_datastore":"base-105-disk-1","replicate":true,"serial":"","size":20,"speed":[],"ssd":false}],"efi_disk":[{"datastore_id":"local-lvm","file_format":"raw","pre_enrolled_keys":false,"type":"4m"}],"hook_script_file_id":"","hostpci":[],"hotplug":null,"id":"105","initialization":[{"datastore_id":"local-lvm","dns":[],"file_format":"","interface":"ide2","ip_config":[{"ipv4":[{"address":"dhcp","gateway":""}],"ipv6":[]}],"meta_data_file_id":"","network_data_file_id":"","type":"","upgrade":true,"user_account":[],"user_data_file_id":"local:snippets/user-data-cloud-config.yaml","vendor_data_file_id":""}],"ipv4_addresses":[],"ipv6_addresses":[],"keyboard_layout":"en-us","kvm_arguments":"","mac_addresses":["BC:24:11:15:8E:EC"],"machine":"q35","memory":[{"dedicated":2048,"floating":0,"hugepages":"","keep_hugepages":false,"shared":0}],"migrate":false,"name":"ubuntu-template","network_device":[{"bridge":"vmbr0","disconnected":false,"enabled":true,"firewall":false,"mac_address":"BC:24:11:15:8E:EC","model":"virtio","mtu":0,"queues":0,"rate_limit":0,"trunks":"","vlan_id":0}],"network_interface_names":[],"node_name":"pve","numa":[],"on_boot":true,"operating_system":[],"pool_id":"","protection":false,"purge_on_destroy":true,"reboot":false,"reboot_after_update":true,"rng":[],"scsi_hardware":"virtio-scsi-pci","serial_device":[],"smbios":[],"started":null,"startup":[],"stop_on_destroy":false,"tablet_device":true,"tags":[],"template":true,"timeout_clone":1800,"timeout_create":1800,"timeout_migrate":1800,"timeout_move_disk":1800,"timeout_reboot":1800,"timeout_shutdown_vm":1800,"timeout_start_vm":1800,"timeout_stop_vm":300,"tpm_state":[],"usb":[],"vga":[],"virtiofs":[],"vm_id":105,"watchdog":[]},"sensitive_attributes":[],"private":"bnVsbA==","dependencies":["data.local_file.ssh_public_key","proxmox_virtual_environment_file.user_data_cloud_config"]}]}],"check_results":null} +{"version":4,"terraform_version":"1.12.1","serial":49,"lineage":"af0feed9-13f3-3cfd-a2e5-f720e7014b48","outputs":{"project_tomorrow_ipv4_address":{"value":"192.168.178.152","type":"string"},"rocky_ipv4_address":{"value":"192.168.178.147","type":"string"}},"resources":[{"mode":"data","type":"local_file","name":"ssh_public_key","provider":"provider[\"registry.opentofu.org/hashicorp/local\"]","instances":[{"schema_version":0,"attributes":{"content":"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNzWdVP6bgpf+Edu9+r+mk+s4xpO2XkM4jOfCvJ2CKe rocky\n","content_base64":"c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUtOeldkVlA2YmdwZitFZHU5K3IrbWsrczR4cE8yWGtNNGpPZkN2SjJDS2Ugcm9ja3kK","content_base64sha256":"AgqOhmLC5TDeSq4+DmxrYp8Tsg2Uof0X6oI/feOHiW4=","content_base64sha512":"968lXZ4JGzTebdeZvQ6m7ZJ0h0ze7J66PT68S8Qu5bYC4ecODmMGVKBMgdvxMdFvn/qtO+uDdcgxz9jRUvrsiw==","content_md5":"e6741967eaea6f76daed9345a3108570","content_sha1":"02d2daf47d4b7a38c969c9936072cecb1d7af10b","content_sha256":"020a8e8662c2e530de4aae3e0e6c6b629f13b20d94a1fd17ea823f7de387896e","content_sha512":"f7af255d9e091b34de6dd799bd0ea6ed9274874cdeec9eba3d3ebc4bc42ee5b602e1e70e0e630654a04c81dbf131d16f9ffaad3beb8375c831cfd8d152faec8b","filename":"./id_ed25519_rocky.pub","id":"02d2daf47d4b7a38c969c9936072cecb1d7af10b"},"sensitive_attributes":[]}]},{"mode":"managed","type":"proxmox_virtual_environment_file","name":"user_data_cloud_config","provider":"provider[\"registry.opentofu.org/bpg/proxmox\"]","instances":[{"schema_version":0,"attributes":{"content_type":"snippets","datastore_id":"local","file_mode":null,"file_modification_date":null,"file_name":"user-data-cloud-config.yaml","file_size":null,"file_tag":null,"id":"local:snippets/user-data-cloud-config.yaml","node_name":"pve","overwrite":true,"source_file":[],"source_raw":[{"data":"#cloud-config\nhostname: test-ubuntu\ntimezone: Europe/Berlin\nusers:\n - default\n - name: ubuntu\n groups:\n - sudo\n shell: /bin/bash\n ssh_authorized_keys:\n - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNzWdVP6bgpf+Edu9+r+mk+s4xpO2XkM4jOfCvJ2CKe rocky\n sudo: ALL=(ALL) NOPASSWD:ALL\npackage_update: true\npackages:\n - qemu-guest-agent\n - net-tools\n - curl\nruncmd:\n - systemctl enable qemu-guest-agent\n - systemctl start qemu-guest-agent\n - echo \"done\" \u003e /tmp/cloud-config.done\n","file_name":"user-data-cloud-config.yaml","resize":0}],"timeout_upload":1800,"upload_mode":"stream"},"sensitive_attributes":[],"private":"bnVsbA==","dependencies":["data.local_file.ssh_public_key"]}]},{"mode":"managed","type":"proxmox_virtual_environment_vm","name":"project-tomorrow","provider":"provider[\"registry.opentofu.org/bpg/proxmox\"]","instances":[{"schema_version":0,"attributes":{"acpi":true,"agent":[{"enabled":true,"timeout":"15m","trim":false,"type":"virtio","wait_for_ip":[]}],"amd_sev":[],"audio_device":[],"bios":"seabios","boot_order":["scsi0","net0"],"cdrom":[],"clone":[{"datastore_id":"","full":true,"node_name":"","retries":1,"vm_id":7000}],"cpu":[],"delete_unreferenced_disks_on_destroy":true,"description":null,"disk":[],"efi_disk":[],"hook_script_file_id":null,"hostpci":[],"hotplug":null,"id":"108","initialization":[{"datastore_id":"local-lvm","dns":[{"domain":"","servers":["1.1.1.1"]}],"file_format":"","interface":"ide0","ip_config":[{"ipv4":[{"address":"dhcp","gateway":""}],"ipv6":[]}],"meta_data_file_id":"","network_data_file_id":"","type":"","upgrade":true,"user_account":[{"keys":["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAouB0XrBRG+yHKbc9OeJ/qf2w2/vT6jbA4AkB1CabGd rocky"],"password":"","username":"rocky"}],"user_data_file_id":"","vendor_data_file_id":""}],"ipv4_addresses":[["127.0.0.1"],["192.168.178.152"]],"ipv6_addresses":[["::1"],["fe80::be24:11ff:fef2:bcc"]],"keyboard_layout":"en-us","kvm_arguments":null,"mac_addresses":["00:00:00:00:00:00","BC:24:11:F2:0B:CC"],"machine":null,"memory":[{"dedicated":4048,"floating":0,"hugepages":"","keep_hugepages":false,"shared":0}],"migrate":false,"name":"project-tomorrow","network_device":[{"bridge":"vmbr0","disconnected":false,"enabled":true,"firewall":false,"mac_address":"BC:24:11:F2:0B:CC","model":"virtio","mtu":0,"queues":0,"rate_limit":0,"trunks":"","vlan_id":0}],"network_interface_names":["lo","eth0"],"node_name":"pve","numa":[],"on_boot":true,"operating_system":[],"pool_id":"","protection":false,"purge_on_destroy":true,"reboot":false,"reboot_after_update":true,"rng":[],"scsi_hardware":"virtio-scsi-pci","serial_device":[],"smbios":[],"started":true,"startup":[],"stop_on_destroy":false,"tablet_device":true,"tags":null,"template":false,"timeout_clone":1800,"timeout_create":1800,"timeout_migrate":1800,"timeout_move_disk":1800,"timeout_reboot":1800,"timeout_shutdown_vm":1800,"timeout_start_vm":1800,"timeout_stop_vm":300,"tpm_state":[],"usb":[],"vga":[],"virtiofs":[],"vm_id":108,"watchdog":[]},"sensitive_attributes":[[{"type":"get_attr","value":"initialization"},{"type":"index","value":{"value":0,"type":"number"}},{"type":"get_attr","value":"user_account"},{"type":"index","value":{"value":0,"type":"number"}},{"type":"get_attr","value":"password"}]],"private":"bnVsbA=="}]},{"mode":"managed","type":"proxmox_virtual_environment_vm","name":"rocky_clone","provider":"provider[\"registry.opentofu.org/bpg/proxmox\"]","instances":[{"schema_version":0,"attributes":{"acpi":true,"agent":[{"enabled":true,"timeout":"15m","trim":false,"type":"virtio","wait_for_ip":[]}],"amd_sev":[],"audio_device":[],"bios":"seabios","boot_order":["scsi0","net0"],"cdrom":[],"clone":[{"datastore_id":"","full":true,"node_name":"","retries":1,"vm_id":7000}],"cpu":[],"delete_unreferenced_disks_on_destroy":true,"description":null,"disk":[],"efi_disk":[],"hook_script_file_id":null,"hostpci":[],"hotplug":null,"id":"105","initialization":[{"datastore_id":"local-lvm","dns":[{"domain":"","servers":["1.1.1.1"]}],"file_format":"","interface":"ide0","ip_config":[{"ipv4":[{"address":"dhcp","gateway":""}],"ipv6":[]}],"meta_data_file_id":"","network_data_file_id":"","type":"","upgrade":true,"user_account":[{"keys":["ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKNzWdVP6bgpf+Edu9+r+mk+s4xpO2XkM4jOfCvJ2CKe rocky"],"password":"","username":"rocky"}],"user_data_file_id":"","vendor_data_file_id":""}],"ipv4_addresses":[["127.0.0.1"],["192.168.178.147"],["100.125.130.72"]],"ipv6_addresses":[["::1"],["2a00:e180:143f:f200:be24:11ff:fe6d:e202","fdf2:88f4:cdc2:0:be24:11ff:fe6d:e202","fe80::be24:11ff:fe6d:e202"],["fd7a:115c:a1e0::5637:8249","fe80::fb8:64ef:502c:632f"]],"keyboard_layout":"en-us","kvm_arguments":null,"mac_addresses":["00:00:00:00:00:00","BC:24:11:6D:E2:02","00:00:00:00:00:00"],"machine":null,"memory":[{"dedicated":2048,"floating":0,"hugepages":"","keep_hugepages":false,"shared":0}],"migrate":false,"name":"rocky-clone","network_device":[{"bridge":"vmbr0","disconnected":false,"enabled":true,"firewall":false,"mac_address":"BC:24:11:6D:E2:02","model":"virtio","mtu":0,"queues":0,"rate_limit":0,"trunks":"","vlan_id":0}],"network_interface_names":["lo","eth0","tailscale0"],"node_name":"pve","numa":[],"on_boot":true,"operating_system":[],"pool_id":"","protection":false,"purge_on_destroy":true,"reboot":false,"reboot_after_update":true,"rng":[],"scsi_hardware":"virtio-scsi-pci","serial_device":[],"smbios":[],"started":true,"startup":[],"stop_on_destroy":false,"tablet_device":true,"tags":null,"template":false,"timeout_clone":1800,"timeout_create":1800,"timeout_migrate":1800,"timeout_move_disk":1800,"timeout_reboot":1800,"timeout_shutdown_vm":1800,"timeout_start_vm":1800,"timeout_stop_vm":300,"tpm_state":[],"usb":[],"vga":[],"virtiofs":[],"vm_id":105,"watchdog":[]},"sensitive_attributes":[[{"type":"get_attr","value":"initialization"},{"type":"index","value":{"value":0,"type":"number"}},{"type":"get_attr","value":"user_account"},{"type":"index","value":{"value":0,"type":"number"}},{"type":"get_attr","value":"password"}]],"private":"bnVsbA=="}]},{"mode":"managed","type":"proxmox_virtual_environment_vm","name":"ubuntu_template","provider":"provider[\"registry.opentofu.org/bpg/proxmox\"]","instances":[{"schema_version":0,"attributes":{"acpi":true,"agent":[],"amd_sev":[],"audio_device":[],"bios":"ovmf","boot_order":["virtio0","net0"],"cdrom":[],"clone":[],"cpu":[{"affinity":"","architecture":"","cores":2,"flags":[],"hotplugged":0,"limit":0,"numa":false,"sockets":1,"type":"qemu64","units":0}],"delete_unreferenced_disks_on_destroy":true,"description":"Managed by OpenTofu","disk":[{"aio":"io_uring","backup":true,"cache":"none","datastore_id":"local-lvm","discard":"on","file_format":"raw","file_id":"local:iso/jammy-server-cloudimg-amd64.img","import_from":"","interface":"virtio0","iothread":true,"path_in_datastore":"base-107-disk-1","replicate":true,"serial":"","size":20,"speed":[],"ssd":false}],"efi_disk":[{"datastore_id":"local-lvm","file_format":"raw","pre_enrolled_keys":false,"type":"4m"}],"hook_script_file_id":"","hostpci":[],"hotplug":null,"id":"107","initialization":[{"datastore_id":"local-lvm","dns":[],"file_format":"","interface":"ide2","ip_config":[{"ipv4":[{"address":"dhcp","gateway":""}],"ipv6":[]}],"meta_data_file_id":"","network_data_file_id":"","type":"","upgrade":true,"user_account":[],"user_data_file_id":"local:snippets/user-data-cloud-config.yaml","vendor_data_file_id":""}],"ipv4_addresses":[],"ipv6_addresses":[],"keyboard_layout":"en-us","kvm_arguments":"","mac_addresses":["BC:24:11:15:A5:AC"],"machine":"q35","memory":[{"dedicated":2048,"floating":0,"hugepages":"","keep_hugepages":false,"shared":0}],"migrate":false,"name":"ubuntu-template","network_device":[{"bridge":"vmbr0","disconnected":false,"enabled":true,"firewall":false,"mac_address":"BC:24:11:15:A5:AC","model":"virtio","mtu":0,"queues":0,"rate_limit":0,"trunks":"","vlan_id":0}],"network_interface_names":[],"node_name":"pve","numa":[],"on_boot":true,"operating_system":[],"pool_id":"","protection":false,"purge_on_destroy":true,"reboot":false,"reboot_after_update":true,"rng":[],"scsi_hardware":"virtio-scsi-pci","serial_device":[],"smbios":[],"started":null,"startup":[],"stop_on_destroy":false,"tablet_device":true,"tags":[],"template":true,"timeout_clone":1800,"timeout_create":1800,"timeout_migrate":1800,"timeout_move_disk":1800,"timeout_reboot":1800,"timeout_shutdown_vm":1800,"timeout_start_vm":1800,"timeout_stop_vm":300,"tpm_state":[],"usb":[],"vga":[],"virtiofs":[],"vm_id":107,"watchdog":[]},"sensitive_attributes":[],"private":"bnVsbA==","dependencies":["data.local_file.ssh_public_key","proxmox_virtual_environment_file.user_data_cloud_config"]}]}],"check_results":null} diff --git a/versions.tf b/versions.tf index 72a6265..6b6ff61 100644 --- a/versions.tf +++ b/versions.tf @@ -1,7 +1,22 @@ terraform { + backend "s3" { + bucket = "tofu-state-proxmox" + endpoint = "https://eu-central-2.storage.impossibleapi.net" + key = "terraform.tfstate" + region = "eu-central-2" + + # use_lockfile = true # ImpossibleCloud doesn't support the required conditional PUT headers + + skip_region_validation = true + skip_credentials_validation = true + skip_requesting_account_id = true + skip_s3_checksum = true + use_path_style = true + } + required_providers { proxmox = { - source = "bpg/proxmox" + source = "bpg/proxmox" version = "0.108.0" } }