diff --git a/images/linux-al2023/github_agent.linux.pkr.hcl b/images/linux-al2023/github_agent.linux.pkr.hcl index ac8c4dff40..05c6d586a4 100644 --- a/images/linux-al2023/github_agent.linux.pkr.hcl +++ b/images/linux-al2023/github_agent.linux.pkr.hcl @@ -143,7 +143,7 @@ build { ] provisioner "shell" { environment_vars = [] - inline = concat([ + inline = [ "sudo dnf upgrade-minimal -y", "sudo dnf install -y amazon-cloudwatch-agent jq git docker", "sudo dnf install -y --allowerasing curl", @@ -151,7 +151,12 @@ build { "sudo systemctl enable containerd.service", "sudo service docker start", "sudo usermod -a -G docker ec2-user", - ], var.custom_shell_commands) + ] + } + + provisioner "shell" { + environment_vars = [] + inline = var.custom_shell_commands } provisioner "file" { diff --git a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl index 56cb65ee5b..1c5f325c52 100644 --- a/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-focal/github_agent.ubuntu.pkr.hcl @@ -144,7 +144,7 @@ build { environment_vars = [ "DEBIAN_FRONTEND=noninteractive" ] - inline = concat([ + inline = [ "sudo cloud-init status --wait", "sudo apt-get -y update", "sudo apt-get -y install ca-certificates curl gnupg lsb-release", @@ -161,7 +161,12 @@ build { "sudo curl -f https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip", "unzip awscliv2.zip", "sudo ./aws/install", - ], var.custom_shell_commands) + ] + } + + provisioner "shell" { + environment_vars = [] + inline = var.custom_shell_commands } provisioner "file" { diff --git a/images/ubuntu-jammy-arm64/github_agent.ubuntu.pkr.hcl b/images/ubuntu-jammy-arm64/github_agent.ubuntu.pkr.hcl index 91e2d7f38e..c82906b011 100644 --- a/images/ubuntu-jammy-arm64/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-jammy-arm64/github_agent.ubuntu.pkr.hcl @@ -144,7 +144,7 @@ build { environment_vars = [ "DEBIAN_FRONTEND=noninteractive" ] - inline = concat([ + inline = [ "sudo cloud-init status --wait", "sudo apt-get update", "sudo apt-get -y install ca-certificates curl gnupg lsb-release", @@ -161,7 +161,12 @@ build { "sudo curl -f https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip -o awscliv2.zip", "unzip awscliv2.zip", "sudo ./aws/install", - ], var.custom_shell_commands) + ] + } + + provisioner "shell" { + environment_vars = [] + inline = var.custom_shell_commands } provisioner "file" { diff --git a/images/ubuntu-jammy/github_agent.ubuntu.pkr.hcl b/images/ubuntu-jammy/github_agent.ubuntu.pkr.hcl index 311bbc5b22..48f8efcdc6 100644 --- a/images/ubuntu-jammy/github_agent.ubuntu.pkr.hcl +++ b/images/ubuntu-jammy/github_agent.ubuntu.pkr.hcl @@ -144,7 +144,7 @@ build { environment_vars = [ "DEBIAN_FRONTEND=noninteractive" ] - inline = concat([ + inline = [ "sudo cloud-init status --wait", "sudo apt-get -y update", "sudo apt-get -y install ca-certificates curl gnupg lsb-release", @@ -161,7 +161,12 @@ build { "sudo curl -f https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip", "unzip awscliv2.zip", "sudo ./aws/install", - ], var.custom_shell_commands) + ] + } + + provisioner "shell" { + environment_vars = [] + inline = var.custom_shell_commands } provisioner "file" { diff --git a/images/windows-core-2019/github_agent.windows.pkr.hcl b/images/windows-core-2019/github_agent.windows.pkr.hcl index 5a31604c01..ad309d0d9d 100644 --- a/images/windows-core-2019/github_agent.windows.pkr.hcl +++ b/images/windows-core-2019/github_agent.windows.pkr.hcl @@ -108,12 +108,18 @@ build { } provisioner "powershell" { - inline = concat([ + inline = [ templatefile("./windows-provisioner.ps1", { action_runner_url = "https://github.com/actions/runner/releases/download/v${local.runner_version}/actions-runner-win-x64-${local.runner_version}.zip" }) - ], var.custom_shell_commands) + ] } + + provisioner "powershell" { + environment_vars = [] + inline = var.custom_shell_commands + } + post-processor "manifest" { output = "manifest.json" strip_path = true diff --git a/images/windows-core-2022/github_agent.windows.pkr.hcl b/images/windows-core-2022/github_agent.windows.pkr.hcl index 18a5ee93c3..45f3ed2692 100644 --- a/images/windows-core-2022/github_agent.windows.pkr.hcl +++ b/images/windows-core-2022/github_agent.windows.pkr.hcl @@ -122,12 +122,18 @@ build { } provisioner "powershell" { - inline = concat([ + inline = [ templatefile("./windows-provisioner.ps1", { action_runner_url = "https://github.com/actions/runner/releases/download/v${local.runner_version}/actions-runner-win-x64-${local.runner_version}.zip" }) - ], var.custom_shell_commands) + ] } + + provisioner "powershell" { + environment_vars = [] + inline = var.custom_shell_commands + } + post-processor "manifest" { output = "manifest.json" strip_path = true