I’m trying to create a “gold ami” from a base ami in the amazon marketplace. That AMI is based on RHEL, but I can’t seem to get it bootstrapped.
"provisioners": [
{
"type": "shell",
"script": "../setup.sh"
},
{
"type": "ansible-local",
"playbook_file": "../playbooks/ship-it.yml",
"playbook_dir": "../playbooks/roles/"
}
]
Result:
==> amazon-ebs: Provisioning with shell script: ../setup.sh
==> amazon-ebs: bash: /tmp/script_9136.sh: Permission denied
If I run the packer build in debug mode and ssh to the instance immediately after the execution fails, I see this when I ls -la
the /tmp
directory:
$ ls -la
total 4
drwxrwxrwt. 9 root root 200 Apr 6 20:14 .
dr-xr-xr-x. 18 root root 236 Sep 23 2019 ..
// SNIP
-rwxr-xr-x. 1 ec2-user ec2-user 378 Apr 6 20:14 script_9136.sh
// SNIP
Any thoughts would be much appreciated.