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에 설정하면 도움이 됩니다.

관련 정보