Ansible接続の問題 - /etc/hosts

Ansible接続の問題 - /etc/hosts

アンサーブル2.9.6、アナコンダ2.7.5

/etc/hosts -> server1 = 10.2.242.4

正常に動作しているときにansible server1 -m command -a "pwd" -vvvプレイブックを実行しようとすると、次のansible-playbook -i inventory test.yml -vvvような結果が表示されます。

<10.2.242.4> ESTABLISH SSH CONNECTION FOR USER: root
<10.2.242.4> SSH: EXEC ssh -C -o ControlMaster=no -o ControlPersist=60s -o Port=22 -o 'IdentityFile="/root/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/f076bfb64e 10.2.242.4 '/bin/sh -c '"'"'echo ~root && sleep 0'"'"''
<10.2.242.4> (0, '/root\n', '')

在庫ファイル:

[waw2]
server1 ansible_host=10.2.242.4

[waw2:vars]
ansible_ssh_port=22
ansible_user=root

私のルート公開鍵がターゲットサーバーに追加されました。ansible.cfg[ssh_connection]セクションでは何も変更されていません。

私は何を見逃していますか?

ベストアンサー1

gather_subset=!hardware解決しました。 ansible.cfgに設定すると便利です。

おすすめ記事