diff --git a/patches/ubuntu/templates/ubuntu-22.04-arm64-aws.pkr.hcl b/patches/ubuntu/templates/ubuntu-22.04-arm64-aws.pkr.hcl index a32682d..3289d77 100644 --- a/patches/ubuntu/templates/ubuntu-22.04-arm64-aws.pkr.hcl +++ b/patches/ubuntu/templates/ubuntu-22.04-arm64-aws.pkr.hcl @@ -170,13 +170,18 @@ build { inline = ["mkdir ${var.image_folder}", "chmod 777 ${var.image_folder}"] } + provisioner "file" { + destination = "${var.helper_script_folder}" + source = "${path.root}/../scripts/helpers" + } + provisioner "shell" { execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'" script = "${path.root}/../scripts/build/configure-apt-mock.sh" } provisioner "shell" { - environment_vars = ["DEBIAN_FRONTEND=noninteractive"] + environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}","DEBIAN_FRONTEND=noninteractive"] execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'" scripts = [ "${path.root}/../scripts/build/install-ms-repos.sh", @@ -190,11 +195,6 @@ build { script = "${path.root}/../scripts/build/configure-limits.sh" } - provisioner "file" { - destination = "${var.helper_script_folder}" - source = "${path.root}/../scripts/helpers" - } - provisioner "file" { destination = "${var.installer_script_folder}" source = "${path.root}/../scripts/build" diff --git a/patches/ubuntu/templates/ubuntu-22.04-x64-aws.pkr.hcl b/patches/ubuntu/templates/ubuntu-22.04-x64-aws.pkr.hcl index 927b231..f1ebc13 100644 --- a/patches/ubuntu/templates/ubuntu-22.04-x64-aws.pkr.hcl +++ b/patches/ubuntu/templates/ubuntu-22.04-x64-aws.pkr.hcl @@ -181,13 +181,18 @@ build { inline = ["mkdir ${var.image_folder}", "chmod 777 ${var.image_folder}"] } + provisioner "file" { + destination = "${var.helper_script_folder}" + source = "${path.root}/../scripts/helpers" + } + provisioner "shell" { execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'" script = "${path.root}/../scripts/build/configure-apt-mock.sh" } provisioner "shell" { - environment_vars = ["DEBIAN_FRONTEND=noninteractive"] + environment_vars = ["HELPER_SCRIPTS=${var.helper_script_folder}","DEBIAN_FRONTEND=noninteractive"] execute_command = "sudo sh -c '{{ .Vars }} {{ .Path }}'" scripts = [ "${path.root}/../scripts/build/install-ms-repos.sh", @@ -201,11 +206,6 @@ build { script = "${path.root}/../scripts/build/configure-limits.sh" } - provisioner "file" { - destination = "${var.helper_script_folder}" - source = "${path.root}/../scripts/helpers" - } - provisioner "file" { destination = "${var.installer_script_folder}" source = "${path.root}/../scripts/build"