를 사용하여 Windows 인스턴스를 ping하려고 할 때 ansible windows -i hosts.ini -m win_ping
다음 오류가 발생했습니다.
54.197.197.91 | UNREACHABLE! => {
"changed": false,
"msg": "plaintext: the specified credentials were rejected by the server",
"unreachable": true
}
내 hosts.ini
파일은 다음과 같습니다.
[windows]
54.197.197.91
[windows:vars]
ansible_ssh_user=Administrator
ansible_ssh_pass=MyPassword123!
ansible_ssh_port=5985
ansible_connection=winrm
이를 해결하기 위해 다음을 수행했습니다.
ansible-vault create secret.yml
다음과 같이 내 비밀번호를 입력했습니다.
win_initial_password: MyPassword123!
그런 다음 내 hosts.ini
파일은 다음과 같습니다.
[windows]
54.197.197.91
[windows:vars]
ansible_ssh_user=Administrator
ansible_ssh_pass={{ win_initial_password }}
ansible_ssh_port=5985
ansible_connection=winrm
핑을 시도했을 때 아래 오류가 발생했습니다.
54.197.197.91 | FAILED! => {
"failed": true,
"msg": "the field 'password' has an invalid value, which appears to include a variable that is undefined. The error was: 'win_initial_password' is undefined"
}
내가 어디로 잘못 가고 있습니까?
다음을 변경하여 해결했습니다.
ansible_ssh_port=5986
ansible_winrm_server_cert_validation=ignore
이것은 효과가 있었다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다