diff --git a/Jenkinsfile b/Jenkinsfile index a29bf04..3804b55 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -78,10 +78,6 @@ pipeline { def apiTokenId = tokenIdAndSecret[0] def apiTokenSecret = tokenIdAndSecret[1] - // Template IDs - def vmTemplateId = '133' - def lxcTemplateId = '109' - sh """ ansible-playbook playbooks/provision.yml \ -e "proxmox_api_user=${apiUser}" \ @@ -91,9 +87,7 @@ pipeline { -e "target_node=${params.TARGET_NODE}" \ -e "vm_hostname=${params.HOSTNAME}" \ -e "cpu_cores=${params.CPU_CORES}" \ - -e "ram_gb=${params.RAM_GB}" \ - -e "vm_template_id=${vmTemplateId}" \ - -e "lxc_template_id=${lxcTemplateId}" + -e "ram_gb=${params.RAM_GB}" """ } } diff --git a/README.md b/README.md index bc5eef0..d749798 100644 --- a/README.md +++ b/README.md @@ -123,11 +123,11 @@ Modify available nodes in the `Jenkinsfile` parameters section. ### Templates -Template VMIDs are configured in the Jenkinsfile environment section: -- `VM_TEMPLATE_ID` - VMID of the VM template (currently: 133) -- `LXC_TEMPLATE_ID` - VMID of the LXC template (currently: 109) +Template VMIDs are configured in the role defaults: +- [roles/proxmox_vm/defaults/main.yml](roles/proxmox_vm/defaults/main.yml) - VM template (VMID: 133) +- [roles/proxmox_lxc/defaults/main.yml](roles/proxmox_lxc/defaults/main.yml) - LXC template (VMID: 109) -Update the values in the `environment` block of the Jenkinsfile to use different templates. +Update the values in these files to use different templates. ## License diff --git a/roles/proxmox_lxc/defaults/main.yml b/roles/proxmox_lxc/defaults/main.yml new file mode 100644 index 0000000..5c51ce0 --- /dev/null +++ b/roles/proxmox_lxc/defaults/main.yml @@ -0,0 +1,2 @@ +--- +lxc_template_id: "109" diff --git a/roles/proxmox_vm/defaults/main.yml b/roles/proxmox_vm/defaults/main.yml new file mode 100644 index 0000000..20ff632 --- /dev/null +++ b/roles/proxmox_vm/defaults/main.yml @@ -0,0 +1,2 @@ +--- +vm_template_id: "133"