I am in the process of porting my code from ansible 2.4.2 to ansible 2.6.x and getting of a lot of this warning,
[WARNING]: Module remote_tmp /root/.ansible/tmp did not exist and was created with a mode of 0700, this may cause issues when running as another user. To avoid this, create the
remote_tmp dir with the correct permissions manually
can someone let me know how to fix that warning. Do we need to create the /root/.ansible/tmp ahead or any other fix for this.
advance thanks
Yes if you read carrefuly the warning, it tell you to create it manually.
What would be the “correct permissions” in this case?
Yeah, that is not really clear.
On second thought the idea is probably that the user is made responsible for choosing correct permissions. Most of the time the default behavior of autocreating the dir is probably enough. Except that you might want to get rid of the warning. But not always.
Let’s consider my case. My playbook contains a bunch of tasks performed under the root account, then a site/app user is created, and there follows another bunch of tasks for the just created user. If all the following tasks are performed under one account, then the user is to be the owner, and permission 0700. If not, you’ve got to make this directory writable for all involved parties. Or so my understanding is.
The interesting thing is that the warning is not displayed before running root tasks. But that is probably since I connect as root, not connect as one user and switch to another one.