When using the ansible provisioner on a system with home directories that are read only, it will fail with Error running "ansible-playbook --version": exit status 5
Reproduction Steps
Create a packer file with an ansible provisioner and custom env vars. We will use a test script as the command to see the full output.
Run the packer file and view the env.log and strace.log files. The env.log will show that none of the custom ansible_env_vars are set, and strace will show an error writing to the default home directory (assuming your home directory is read-only)
Adding skip_version_check = true to the ansible provisioner prevents this error, as the env vars are set correctly before the actual ansible playbook is run.
Overview of the Issue
When using the ansible provisioner on a system with home directories that are read only, it will fail with
Error running "ansible-playbook --version": exit status 5
Reproduction Steps
Create a packer file with an ansible provisioner and custom env vars. We will use a test script as the command to see the full output.
/tmp/test.sh contains
Run the packer file and view the env.log and strace.log files. The env.log will show that none of the custom
ansible_env_vars
are set, and strace will show an error writing to the default home directory (assuming your home directory is read-only)Adding
skip_version_check = true
to the ansible provisioner prevents this error, as the env vars are set correctly before the actual ansible playbook is run.Packer version
Packer v1.8.5
Operating system and Environment details
Debian 11