ansible roles default files
This commit is contained in:
8
Jenkinsfile
vendored
8
Jenkinsfile
vendored
@@ -78,10 +78,6 @@ pipeline {
|
|||||||
def apiTokenId = tokenIdAndSecret[0]
|
def apiTokenId = tokenIdAndSecret[0]
|
||||||
def apiTokenSecret = tokenIdAndSecret[1]
|
def apiTokenSecret = tokenIdAndSecret[1]
|
||||||
|
|
||||||
// Template IDs
|
|
||||||
def vmTemplateId = '133'
|
|
||||||
def lxcTemplateId = '109'
|
|
||||||
|
|
||||||
sh """
|
sh """
|
||||||
ansible-playbook playbooks/provision.yml \
|
ansible-playbook playbooks/provision.yml \
|
||||||
-e "proxmox_api_user=${apiUser}" \
|
-e "proxmox_api_user=${apiUser}" \
|
||||||
@@ -91,9 +87,7 @@ pipeline {
|
|||||||
-e "target_node=${params.TARGET_NODE}" \
|
-e "target_node=${params.TARGET_NODE}" \
|
||||||
-e "vm_hostname=${params.HOSTNAME}" \
|
-e "vm_hostname=${params.HOSTNAME}" \
|
||||||
-e "cpu_cores=${params.CPU_CORES}" \
|
-e "cpu_cores=${params.CPU_CORES}" \
|
||||||
-e "ram_gb=${params.RAM_GB}" \
|
-e "ram_gb=${params.RAM_GB}"
|
||||||
-e "vm_template_id=${vmTemplateId}" \
|
|
||||||
-e "lxc_template_id=${lxcTemplateId}"
|
|
||||||
"""
|
"""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,11 +123,11 @@ Modify available nodes in the `Jenkinsfile` parameters section.
|
|||||||
|
|
||||||
### Templates
|
### Templates
|
||||||
|
|
||||||
Template VMIDs are configured in the Jenkinsfile environment section:
|
Template VMIDs are configured in the role defaults:
|
||||||
- `VM_TEMPLATE_ID` - VMID of the VM template (currently: 133)
|
- [roles/proxmox_vm/defaults/main.yml](roles/proxmox_vm/defaults/main.yml) - VM template (VMID: 133)
|
||||||
- `LXC_TEMPLATE_ID` - VMID of the LXC template (currently: 109)
|
- [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
|
## License
|
||||||
|
|
||||||
|
|||||||
2
roles/proxmox_lxc/defaults/main.yml
Normal file
2
roles/proxmox_lxc/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
lxc_template_id: "109"
|
||||||
2
roles/proxmox_vm/defaults/main.yml
Normal file
2
roles/proxmox_vm/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
vm_template_id: "133"
|
||||||
Reference in New Issue
Block a user