私は9台のサーバを持っていますが、私は可能性のあるパッケージをインストールしようとしています。私は5台のサーバにパスワードを使用でき、他の4台はssh'ng中にパスワードを要求しません。可能:「sudo:パスワードが必要です」というエラーを解決する方法はありますか?
しかし、私はすべての9台のサーバーにid_rsa.pubキーをコピーしました。
ここでは、5つのサーバで正常に動作していますが、残りの4つは次のエラーメッセージが表示されます。
fatal: [xxx0?]: FAILED! => {"changed": false, "failed": true, "module_stderr": "Connection to xxx0? closed.\r\n", "module_stdout": "sudo: a password is required\r\n", "msg": "MODULE FAILURE", "rc": 1}
マイAnsible.cfg
[defaults]
filter_plugins =./filter_plugins
roles_path = ./roles
sudo_user = root
host_key_checking = False
retry_files_enabled = False
password = ~/password.txt
timeout = 25
[ssh_connection]
ssh_args = -F ~/.ssh/config -o ControlMaster=no -o ControlPersist=30m
control_path = ~/.ssh/ansible-%%[email protected]%%h:%%p
の〜/ .ssh/configに
Host xx0? xx0? xx0? xx0? xx0? xx0? xx0? xx0? xx0? .xyz.com
User yyy
Port 22
ansibleバージョン= 2.3.1.0 ansible
どのように私はこのエラーを解決することができますか?
おそらく、失敗している4台のサーバー上の.pubファイルにアクセス許可エラーがあります。 – Difster
どこに.pubファイルがありますか? – Swat
あなたがコピーしたディレクトリにあります。私がそれを知る方法はありません。 また、他のコメントを残して申し訳ありませんが、別の質問のためのものでした。削除されました。 – Difster