title: Ansible : "msg": "Failed to create temporary directory.In some cases..... fatal: [localhost]: UNREACHABLE! =>
body: <p>i have simple playbook that print hello world in windows 10 WSL ubuntu 
  i invoke : </p>
  
  <pre><code>ansible-playbook hello-world.yml -vvv
  </code></pre>
  
  <p>the ansible.cfg:</p>
  
  <pre><code>[defaults]
  remote_user = root
  remote_tmp = /home/foo/projects/ansible_tmp
  </code></pre>
  
  <p>I'm getting the error:</p>
  
  <pre><code>foo@foo-LP:~/projects$ ansible-playbook hello-world.yml -vvv
  ansible-playbook 2.9.9
    config file = /etc/ansible/ansible.cfg
    configured module search path = ['/home/foo/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
    ansible python module location = /home/foo/.local/lib/python3.8/site-packages/ansible
    executable location = /home/foo/.local/bin/ansible-playbook
    python version = 3.8.2 (default, Apr 27 2020, 15:53:34) [GCC 9.3.0]
  Using /etc/ansible/ansible.cfg as config file
  host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
  Skipping due to inventory source not existing or not being readable by the current user
  script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
  auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
  Skipping due to inventory source not existing or not being readable by the current user
  yaml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
  Skipping due to inventory source not existing or not being readable by the current user
  ini declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
  Skipping due to inventory source not existing or not being readable by the current user
  toml declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
  [WARNING]: No inventory was parsed, only implicit localhost is available
  [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
  
  PLAYBOOK: hello-world.yml *******************************************************************************************************************************************************************************************************************
  1 plays in hello-world.yml
  
  PLAY [Echo] *********************************************************************************************************************************************************************************************************************************
  
  TASK [Gathering Facts] **********************************************************************************************************************************************************************************************************************
  task path: /home/foo/projects/hello-world.yml:1
  &lt;127.0.0.1&gt; ESTABLISH LOCAL CONNECTION FOR USER: foo
  &lt;127.0.0.1&gt; EXEC /bin/sh -c '( umask 77 &amp;&amp; mkdir -p "` echo /home/foo/projects/ansible_tmp `"&amp;&amp; mkdir /home/foo/projects/ansible_tmp/ansible-tmp-1592072036.299761-1251-15575474283021 &amp;&amp; echo ansible-tmp-1592072036.299761-1251-15575474283021="` echo /home/foo/projects/ansible_tmp/ansible-tmp-1592072036.299761-1251-15575474283021 `" ) &amp;&amp; sleep 0'
  fatal: [localhost]: UNREACHABLE! =&gt; {
      "changed": false,
      "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 &amp;&amp; mkdir -p \"` echo /home/foo/projects/ansible_tmp `\"&amp;&amp; mkdir /home/foo/projects/ansible_tmp/ansible-tmp-1592072036.299761-1251-15575474283021 &amp;&amp; echo ansible-tmp-1592072036.299761-1251-15575474283021=\"` echo /home/foo/projects/ansible_tmp/ansible-tmp-1592072036.299761-1251-15575474283021 `\" ), exited with result 1, stdout output: ansible-tmp-1592072036.299761-1251-15575474283021=/home/foo/projects/ansible_tmp/ansible-tmp-1592072036.299761-1251-15575474283021\n",
      "unreachable": true
  }
  
  PLAY RECAP **********************************************************************************************************************************************************************************************************************************
  localhost                  : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0
  </code></pre>
  
  <p>here is the ansible_tmp directory as you can see files do created :</p>
  
  <pre><code>foo@foo-LP:~/projects/ansible_tmp$ ls -l
  total 0
  drwx------ 1 foo foo 512 Jun 13 20:58 ansible-tmp-1592071117.4568608-1061-140750827389855
  drwx------ 1 foo foo 512 Jun 13 21:04 ansible-tmp-1592071482.7000341-1178-197961143036553
  drwx------ 1 foo foo 512 Jun 13 21:05 ansible-tmp-1592071559.571779-1200-194490972570368
  drwx------ 1 foo foo 512 Jun 13 21:13 ansible-tmp-1592072036.299761-1251-15575474283021
  </code></pre>