Check permission of the files and try to run that command directly without using ansible.
On Sat, Jun 13, 2020, 10:09 PM ajith u <[email protected]> wrote: > that works , but due to other restrictions, need to run that playbook as > non-root user. > > On Sat, Jun 13, 2020 at 10:05 PM 'Tarun Mittal' via Packer < > [email protected]> wrote: > >> Try to run ansible-playbook as become_user using root >> >> On Sat, Jun 13, 2020, 9:43 PM ajith u <[email protected]> wrote: >> >>> 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 >>> <https://groups.google.com/d/msgid/packer-tool/CAHGGiCRm01TyDZZEudn3ceje%3D%3DTPy9N_OUmboUfmw21Fge8dnQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> >> *Note:* This message is the property of HashedIn and its subsidiaries. >> It may be legally privileged and/or confidential and is intended only for >> the use of the addressee(s). No addressee should forward, print, copy, or >> otherwise reproduce this message in any manner that would allow it to be >> viewed by any individual not originally listed as a recipient. If the >> reader of this message is not the intended recipient, you are hereby >> notified that any unauthorized disclosure, dissemination, distribution, >> copying or the taking of any action in reliance on the information herein >> is strictly prohibited. If you have received this communication in error, >> please immediately notify the sender and delete this message. >> >> -- >> 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/CA%2BUggvjEo2Ycshu%3DrHktX8VcpXHLD34XM2JaEHt9af-JC_3b0w%40mail.gmail.com >> <https://groups.google.com/d/msgid/packer-tool/CA%2BUggvjEo2Ycshu%3DrHktX8VcpXHLD34XM2JaEHt9af-JC_3b0w%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > Follow my page : https://www.facebook.com/ColouredClicks > > -- > 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/CAHGGiCRfLC8Zoc%2BBTesMxe4n%3DerkVqt4DqoAOkrPF1S_nv9FWw%40mail.gmail.com > <https://groups.google.com/d/msgid/packer-tool/CAHGGiCRfLC8Zoc%2BBTesMxe4n%3DerkVqt4DqoAOkrPF1S_nv9FWw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- **Note:** This message is the property of HashedIn and its subsidiaries. It may be legally privileged and/or confidential and is intended only for the use of the addressee(s). No addressee should forward, print, copy, or otherwise reproduce this message in any manner that would allow it to be viewed by any individual not originally listed as a recipient. If the reader of this message is not the intended recipient, you are hereby notified that any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is strictly prohibited. If you have received this communication in error, please immediately notify the sender and delete this message. -- 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/CA%2BUggvj%3DON3%2BgqvGnKbXUUTRzJt0WN7Z2o76gS6og7bh8o%2B9sQ%40mail.gmail.com.
