我无法使用 Ansible 更改密码。这可能是我的剧本。
我需要为特定用户更改此密码。授权密钥部分中的 ssh 密钥相同。不确定为什么这无法连接到另一台机器。
- hosts: HOSTNAME.austin.ibm.com
tasks:
- name: Change Root Password
user: name=root update_password=always password=passw0rd1
这是我的错误信息:
ubuntu@ans-test:/etc/ansible$ sudo ansible-playbook -s password.yml
sudo: unable to resolve host ans-test
PLAY [HOSTNAME.austin.ibm.com] **************************************************
TASK [setup] *******************************************************************
The authenticity of host 'HOSTNAME.austin.ibm.com (9.3.214.197)' can't be established.
ECDSA key fingerprint is SHA256:pX3FVgOCBmVTy29IbM+uPQkKYDa3GBehj4t1BekZxGw.
Are you sure you want to continue connecting (yes/no)? yes
fatal: [arlz197.austin.ibm.com]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true}
to retry, use: --limit @password.retry
PLAY RECAP *********************************************************************
HOSTNAME.austin.ibm.com : ok=0 changed=0 unreachable=1 failed=0