Hi,
I am using packer to create an image which has a playbook which is being executed as a non-root user. While running the packer build command I get below error in the ansible playbook secion.
docker: TASK [Gathering Facts] *********************************************************
docker: fatal: [default]: FAILED! => {"msg": "Failed to change ownership of the temporary files Ansible needs to create despite connecting as a privileged user. Unprivileged become user would be unable to read the file."}
I did some googling and added below option in the json file.
..
..
{
"type": "ansible",
"user": "root",
"playbook_file": "../../../ansible/playbooks/build/build.yml",
"extra_arguments": [
"--extra-vars",
"ansible_host={{user `ansible_host`}} ansible_connection={{user `ansible_connection`}} allow_world_readable_tmpfiles=true"
]
}
..
..
Please let me know if any other places I can give this option.
thanks,
Ajith