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

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAHGGiCRm01TyDZZEudn3ceje%3D%3DTPy9N_OUmboUfmw21Fge8dnQ%40mail.gmail.com.

Reply via email to