From f6ddfc535de2a38005a0d6e32f7c4fe1895f9356 Mon Sep 17 00:00:00 2001 From: Sai Diliyaer Date: Tue, 5 Mar 2024 20:49:32 -0500 Subject: [PATCH] Update Jenkins template example for supervisor builder (#375) --- .../examples/supervisor/jenkins-template.pkr.hcl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/builder/vsphere/examples/supervisor/jenkins-template.pkr.hcl b/builder/vsphere/examples/supervisor/jenkins-template.pkr.hcl index c29217ed6..cbc8d1a62 100644 --- a/builder/vsphere/examples/supervisor/jenkins-template.pkr.hcl +++ b/builder/vsphere/examples/supervisor/jenkins-template.pkr.hcl @@ -119,9 +119,14 @@ EOF provisioner "shell" { inline = [ - # Install Jenkins and its dependencies. - "curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null", - "echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null", + # Download Jenkins repository key and add it to the trusted keyrings. + "curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo gpg --dearmor -o /usr/share/keyrings/jenkins-keyring.gpg", + "echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.gpg] https://pkg.jenkins.io/debian binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list", + + # Download the new Kubernetes community-owned repository key and add it to the trusted keyrings (to get apt-get update working). + "curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /usr/share/keyrings/kubernetes-apt-keyring.gpg", + "echo deb [signed-by=/usr/share/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ / | sudo tee /etc/apt/sources.list.d/kubernetes.list", + # Sometimes apt-get uses IPv6 and causes failure, force to use IPv4 address. "sudo apt-get -qq -o Acquire::ForceIPv4=true update", "sudo apt-get -qq -o Acquire::ForceIPv4=true install -f -y ca-certificates openjdk-11-jre-headless",