Hi Packer Community,
I’m working on packer to build custom AMI for AWS EC2 instances.
I use the shell provisioner to exec multiple scripts from the inline attribute like in the following example :
provisioner "shell" {
# allow the server to disconnect from Packer without throwing an error. A disconnect might happen if you restart the SSH server or reboot the host
expect_disconnect = true
environment_vars = [
"DEBIAN_FRONTEND=noninteractive"
]
inline = [
"sudo /tmp/script1.sh",
"sudo /tmp/script2.sh"
]
}
My first script end with a command loginctl terminate-user ubuntu, and packer stop the provisioning without executing script2.sh.
Do you have an idea to solve this ?
Thanks