Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • I see, thanks for the explanation. Is there any workaround for it?
    – atb00ker
    Commented Feb 5, 2020 at 15:59
  • 2
    You're welcome. There shouldn't be any workaround to access root files without root permission. Commented Feb 5, 2020 at 16:03
  • @VladimirBotka This makes sense. But I also don't want all my other tasks to run as sudo (by running the playbook as sudo). Only those that have become: yes. So IIUC my options to 1. Change src file permissions or ownership with some become: yes task before the copy task (and restore original state again). 2. Specify for all other tasks to run as non-sudo somehow and run the playbook as sudo?
    – Carolus
    Commented Sep 13, 2020 at 13:22
  • and 3. Use the command module as explained by OP.
    – Carolus
    Commented Sep 13, 2020 at 13:29
  • @Carolus: only option 1 will work. I've updated the answer. Feel free to test other options and post your answer, or question with the code. Commented Sep 13, 2020 at 16:41