
특정 서버에 대한 SSH 액세스 권한이 있지만 해당 서버에 대한 플레이북을 실행하려고 할 때. 해당 서버에 대한 배포를 수행하려고 하는데 문제가 있습니다.
fatal: [lapp999.corp.com]]: UNREACHABLE! => {"changed": false, "msg": "Data could not be sent to remote host \"lapp999.corp.com\". Make sure this host can be reached over ssh: ********************************************************************************\n
!!!WARNING!!!\n********************************************************************************\nThis system is a restricted access system. All activity on this system is\nsubject to monitoring. Information collected that is malicious, unauthorized or\nunlawful, may be provided to the relevant authorities for further action. By\ncontinuing past this point, you expressly consent to this monitoring.\n********************************************************************************\
[email protected]: Permission denied (publickey).\r\n", "unreachable": true}
누군가 이 문제를 해결하도록 도와주실 수 있나요?
답변1
ansible-playbook -vvv
Verbosity 3은 SSH 명령줄을 포함하여 인쇄 명령 실행을 시작합니다. 이것을 대화식으로 작동한다고 주장하는 ssh 명령과 비교하십시오.
IdentityFile
이 호스트에 대해 설정해야 하는지 확인 ssh_config
하고, 그렇다면 어떤 자격 증명에 설정해야 하는지 확인하세요 .
Ansible의 기본값은 대화형 SSH 옵션을 사용하지 않는 것입니다. 비밀번호가 필요하다면 --ask-pass
명령줄을 통해 비밀번호를 제공하거나 변수를 설정 ansible_password
하고 sshpass
프로그램을 설치해야 합니다. 왜냐하면 OpenSSH는 실제로 비밀번호 자동화를 원하지 않기 때문입니다.