From 84e83c944d29a759f2dc5544188f1a3ce2446115 Mon Sep 17 00:00:00 2001 From: jerick Date: Mon, 2 Feb 2026 16:45:09 -0500 Subject: [PATCH] hardcoded template names in script blocks --- Jenkinsfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 934fd78..a4ecdfb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,8 +42,6 @@ pipeline { environment { ANSIBLE_HOST_KEY_CHECKING = 'False' ANSIBLE_FORCE_COLOR = 'true' - VM_TEMPLATE_HOSTNAME = 'ubuntu24vm' - LXC_TEMPLATE_HOSTNAME = 'ubuntu24lxc' } stages { @@ -100,7 +98,7 @@ pipeline { steps { script { // Use template hostname for ping since the cloned machine still has the template's hostname - def templateHost = params.PROVISION_TYPE == 'VM' ? env.VM_TEMPLATE_HOSTNAME : env.LXC_TEMPLATE_HOSTNAME + def templateHost = params.PROVISION_TYPE == 'VM' ? 'ubuntu24vm' : 'ubuntu24lxc' def targetHost = "${templateHost}.lan" echo "Waiting for ${targetHost} (template hostname) to become available..." @@ -124,7 +122,7 @@ pipeline { stage('Copy Jenkins SSH Key') { steps { script { - def templateHost = params.PROVISION_TYPE == 'VM' ? env.VM_TEMPLATE_HOSTNAME : env.LXC_TEMPLATE_HOSTNAME + def templateHost = params.PROVISION_TYPE == 'VM' ? 'ubuntu24vm' : 'ubuntu24lxc' def targetHost = "${templateHost}.lan" // Use sshpass or expect to handle the initial connection @@ -139,7 +137,7 @@ pipeline { stage('Set Hostname') { steps { script { - def templateHost = params.PROVISION_TYPE == 'VM' ? env.VM_TEMPLATE_HOSTNAME : env.LXC_TEMPLATE_HOSTNAME + def templateHost = params.PROVISION_TYPE == 'VM' ? 'ubuntu24vm' : 'ubuntu24lxc' def currentHost = "${templateHost}.lan" def newHostname = params.HOSTNAME