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