I am trying to build off from an aws ami from aws marketplace using Packer. I am running into issues where the ami automatically pops up an interactive shell prompt (agreeing to licenses) when you ssh. So the Packer issue is when Provisioning with shell script that I have, it gets stuck uploading because of the interactive shell prompt.
The error will come up as this:
Error uploading script: { big text from license agreement }
Could you provide a bit more information, e.g., the AMI id in the marketplace? Perhaps there is an environment variable which you can set to turn off the interactive prompt, similar to setting DEBIAN_FRONTEND when doing unattended actions on apt ?
It may also be possible to use a single provisioner to simply echo yes into the first shell, but that depends on what the prompt expects.
Thanks for helping! I am trying to build off from the OpenVPN AMI. Once you hit yes for the first initial prompt, there is more interactive prompts (6 yes/no questions). I tried using DEBIAN_FRONTEND=noninteractive but does not seem to work.
This sounds more like an expect problem than an apt problem. I haven’t confirmed yet, but from what @sudovinh says, the AMI is configured with a startup script that expects user input. So, Packer needs to be able to run a provisioner to send that input to the script. Does this sound right?