WSL中的URI产生身份验证或权限失败

问题描述

尝试在WSL中的Windows上使用Ansible URI模块,但出现如下错误

fatal: [127.0.0.1]: UNREACHABLE! => {"changed": false,"msg": "Authentication or permission failure. 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\". Failed command was: ( umask 77 && mkdir -p \"` echo /tmp/.ansible-masereda/tmp/ansible-tmp-1597310597.9032378-169463714398203 `\" && echo ansible-tmp-1597310597.9032378-169463714398203=\"` echo /tmp/.ansible-masereda/tmp/ansible-tmp-1597310597.9032378-169463714398203 `\" ),exited with result 1,stdout output: ansible-tmp-1597310597.9032378-169463714398203=/tmp/.ansible-masereda/tmp/ansible-tmp-1597310597.9032378-169463714398203\n","unreachable": true}

我的剧本看起来像这样

---
- hosts: local
  gather_facts: False
  tasks:
    - name: Check that you can connect (GET) to a page and it returns a status 200
      uri:
        url: http://www.example.com

在ansible.cfg中添加remote_tmp = /tmp/.ansible-masereda/tmp,但没有帮助

文件/tmp/具有这样的权限

drwxrwxrwt 1 root     root     4096 Aug 13 14:25 .
drwxr-xr-x 1 root     root     4096 Jul 31 14:42 ..
drwxrwxrwx 1 masereda masereda 4096 Aug 13 10:54 .ansible-masereda

在linux上也尝试过,并且可以正常工作。所以,认为问题出在WSL

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)