ansible在easy_install中提示输入ssh密码

ansible在easy_install中提示输入ssh密码,ansible,ansible-2.x,ansible-facts,Ansible,Ansible 2.x,Ansible Facts,团队, 我需要使用我的macbook抱怨dnspython需要的dig模块。所以我用easy_install安装它,但我得到提示输入密码。如何使其无密码 - easy_install: name: dnspython state: present become: yes - name: Validate DNS record lookup for {{ kubeapi_server }} debug

团队, 我需要使用我的macbook抱怨dnspython需要的dig模块。所以我用easy_install安装它,但我得到提示输入密码。如何使其无密码

      - easy_install:
          name: dnspython
          state: present
        become: yes

      - name: Validate DNS record lookup for {{ kubeapi_server }}
        debug: msg="{{ lookup('dig', '{{ kubeapi_server }}' )}}"
        vars:
          variable: "{{ lookup('dig', '{{ kubeapi_server }}' )}}"
        failed_when: not variable

输出1:带-k选项

ansible-playbook -i inventory.txt playbook.yaml -k -K
SSH password: 
BECOME password[defaults to SSH password]: 

输出1:不带-k-k选项

ansible-playbook -i inventory.txt playbook.yaml
可能的原因可能是: 1.您没有在主机清单中指定密码。 2.用户的sudo权限应该是主机的/etc/sudoers中的NOPASSWD:ALL

TASK [0_test : easy_install] ***************************
fatal: [target1]: FAILED! => {"changed": false, "msg": "error: can't create or remove files in install directory\n\nThe following error occurred while trying to add or remove files in the\ninstallation directory:\n\n    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-68421.pth'\n\nThe installation directory you specified (via --install-dir, --prefix, or\nthe distutils default setting) was:\n\n    /Library/Python/2.7/site-packages/\n\nPerhaps your account does not have write access to this directory?  If the\ninstallation directory is a system-owned directory, you may need to sign in\nas the administrator or \"root\" account.  If you do not have administrative\naccess to this machine, you may wish to choose a different installation\ndirectory, preferably one that is listed in your PYTHONPATH environment\nvariable.\n\nFor information on other options, you may wish to consult the\ndocumentation at:\n\n  https://pythonhosted.org/setuptools/easy_install.html\n\nPlease make the appropriate changes for your system and try again.\n\n"}