This commit is contained in:
parent
53714ec45f
commit
229e0ef85a
2 changed files with 13 additions and 40 deletions
|
@ -17,7 +17,7 @@ jobs:
|
||||||
echo "Extracting issue details..."
|
echo "Extracting issue details..."
|
||||||
ISSUE_BODY="${{ github.event.issue.body }}"
|
ISSUE_BODY="${{ github.event.issue.body }}"
|
||||||
VM_NAME=$(echo "$ISSUE_BODY" | grep -A 2 'VM Name' | tail -n 1 | xargs)
|
VM_NAME=$(echo "$ISSUE_BODY" | grep -A 2 'VM Name' | tail -n 1 | xargs)
|
||||||
VM_ID=$(echo "$ISSUE_BODY" | grep -A 2 'VM ID' | tail -n 1 | xargs)
|
VM_ID=$(echo "$ISSUE_BODY" | grep -A 2 'VM ID' | grep -v 'Clone VM ID' | tail -n 1 | xargs)
|
||||||
RAM=$(echo "$ISSUE_BODY" | grep -A 2 'RAM' | tail -n 1 | xargs)
|
RAM=$(echo "$ISSUE_BODY" | grep -A 2 'RAM' | tail -n 1 | xargs)
|
||||||
CPUS=$(echo "$ISSUE_BODY" | grep -A 2 'CPU Cores' | tail -n 1 | xargs)
|
CPUS=$(echo "$ISSUE_BODY" | grep -A 2 'CPU Cores' | tail -n 1 | xargs)
|
||||||
SCPU_TYPE=$(echo "$ISSUE_BODY" | grep -A 2 'CPU Type' | tail -n 1 | xargs)
|
SCPU_TYPE=$(echo "$ISSUE_BODY" | grep -A 2 'CPU Type' | tail -n 1 | xargs)
|
||||||
|
@ -100,3 +100,15 @@ jobs:
|
||||||
git add terraform/proxmox/$VM_NAME.tf
|
git add terraform/proxmox/$VM_NAME.tf
|
||||||
git commit -m "Add VM $VM_NAME configuration"
|
git commit -m "Add VM $VM_NAME configuration"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
|
|
||||||
|
- name: Trigger Terraform Apply Workflow
|
||||||
|
uses: https://github.com/actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
github.rest.actions.createWorkflowDispatch({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
workflow_id: "tofu.yml",
|
||||||
|
ref: "main"
|
||||||
|
})
|
|
@ -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
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue