diff --git a/.forgejo/workflows/tofu-issue-deploy.yml b/.forgejo/workflows/tofu-issue-deploy.yml index 9c4a619..b731b03 100644 --- a/.forgejo/workflows/tofu-issue-deploy.yml +++ b/.forgejo/workflows/tofu-issue-deploy.yml @@ -26,6 +26,7 @@ jobs: DATASTORE=$(echo "$ISSUE_BODY" | grep -A 2 'Datastore ID' | tail -n 1 | xargs) DISK_SIZE=$(echo "$ISSUE_BODY" | grep -A 2 'Disk Size' | tail -n 1 | xargs) CLONE_VM_ID=$(echo "$ISSUE_BODY" | grep -A 2 'Clone VM ID' | tail -n 1 | xargs) + DESCRIPTION=$(echo "$ISSUE_BODY" | grep -A 2 'Description' | tail -n 1 | xargs) # Determine user_data_file_id if [ "$NODE_NAME" == "prox" ]; then @@ -59,6 +60,7 @@ jobs: cpu { cores = "${{ env.CPUS }}" type = "${{ env.SCPU_TYPE }}" + architecture = "x86_64" } memory { @@ -67,12 +69,15 @@ jobs: network_device { bridge = "vmbr0" + {{- if env.VLAN_ID }} vlan_id = "${{ env.VLAN_ID }}" + {{- end }} } disk { datastore_id = "${{ env.DATASTORE }}" size = "${{ env.DISK_SIZE }}" + interface = "scsi0" } clone { @@ -88,6 +93,15 @@ jobs: user_data_file_id = ${{ env.USER_DATA_FILE_ID }} } + + lifecycle { + ignore_changes = [ + initialization[0].user_account[0].keys, + initialization[0].user_account[0].password, + initialization[0].user_account[0].username, + initialization[0].user_data_file_id + ] + } } EOF diff --git a/.github/ISSUE_TEMPLATE/deploy-vm.yml b/.github/ISSUE_TEMPLATE/deploy-vm.yml index 69f3981..da07a81 100644 --- a/.github/ISSUE_TEMPLATE/deploy-vm.yml +++ b/.github/ISSUE_TEMPLATE/deploy-vm.yml @@ -14,6 +14,15 @@ body: description: The name of the virtual machine (e.g., Plausible). validations: required: true + + - type: input + id: description + attributes: + label: Description + placeholder: Enter the VM Description + description: Enter the VM Description + validations: + required: true - type: input id: vm_id @@ -67,7 +76,7 @@ body: placeholder: Enter the VLAN ID description: The VLAN ID for the network device (e.g., 1). validations: - required: true + required: false - type: input id: datastore diff --git a/terraform/proxmox/Test.tf b/terraform/proxmox/Test.tf deleted file mode 100644 index f26278c..0000000 --- a/terraform/proxmox/Test.tf +++ /dev/null @@ -1,39 +0,0 @@ -resource "proxmox_virtual_environment_vm" "Test" { - node_name = "prox" - vm_id = "5656" - name = "Test" - description = "Test" - - cpu { - cores = "2" - type = "host" - } - - memory { - dedicated = "2048" - } - - network_device { - bridge = "vmbr0" - vlan_id = "1" - } - - disk { - datastore_id = "Fast2Tb" - size = "20" - } - - clone { - vm_id = "9996" - } - - initialization { - ip_config { - ipv4 { - address = "dhcp" - } - } - - user_data_file_id = proxmox_virtual_environment_file.cloud_config.id - } -} diff --git a/terraform/proxmox/test.tf b/terraform/proxmox/test.tf deleted file mode 100644 index c65620c..0000000 --- a/terraform/proxmox/test.tf +++ /dev/null @@ -1,39 +0,0 @@ -resource "proxmox_virtual_environment_vm" "test" { - node_name = "prox" - vm_id = "9996" - name = "test" - description = "test" - - cpu { - cores = "2" - type = "host" - } - - memory { - dedicated = "2048" - } - - network_device { - bridge = "vmbr0" - vlan_id = "1" - } - - disk { - datastore_id = "Fast2Tb" - size = "20" - } - - clone { - vm_id = "9996" - } - - initialization { - ip_config { - ipv4 { - address = "dhcp" - } - } - - user_data_file_id = proxmox_virtual_environment_file.cloud_config.id - } -}