запрашивается ssh-пароль от ansible в easy_install - PullRequest
0 голосов
/ 11 октября 2019

Команда, мне нужно использовать модуль dig, который, по словам моего macbook, требует dnspython. поэтому я устанавливаю его с помощью 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

output1: с опцией -k

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

output1: без опции -k -K

ansible-playbook -i inventory.txt playbook.yaml
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"}

1 Ответ

0 голосов
/ 11 октября 2019

Возможные причины: 1. Вы не указали пароль в инвентаре хост-машины. 2. Разрешение sudo пользователя должно быть NOPASSWD: ВСЕ в / etc / sudoers хост-машины.

...