Authentication or permission failure

容器裏使用ansible 項目報錯

PLAY [bootstrap installer] ****

GATHERING FACTS ***
fatal: [localhost] => Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: mkdir -p $HOME/.ansible/tmp/ansible-tmp-1403661775.03-87881370436819 && echo $HOME/.ansible/tmp/ansible-tmp-14036534175.03-87881370436819, exited with result 127

處理方法:

#yum -y install openssh-clients

Ansible正在容器中運行,試圖連接到容器,因此您需要同時授權容器和root用戶.容器必須是已知主機,並且必須授權root的公鑰.例如:
RUN ssh-keyscan -t rsa 127.0.0.1 >>/root/.ssh/known_hosts
RUN cat /root/.ssh/id_rsa.pub >>/root/.ssh/authorized_keys

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章