I need to change the directory where packer runs the AMI provisioning script from /tmp/packer-shell975270284 because our instances don't allow scripts to be run form /tmp.
This script needs to run in /opt or /home/ec2-user. where it will have permissions
Below is the error that I am getting after the ansible playbook ran.
==> amazon-ebs: Provisioning with shell script: /tmp/packer-shell975270284
Build 'amazon-ebs' errored: Error uploading script: scp: /tmp/script_5412.sh: Permission denied.
==> Some builds didn't complete successfully and had errors.
==> Builds finished but no artifacts were created.