ansible ssh prompt known_hosts issue

前端 未结 7 1257
甜味超标
甜味超标 2020-12-23 16:25

I\'m running Ansible playbook and it works fine on one machine.

On a new machine when I try for the first time, I get the following error.

17:04:34          


        
7条回答
  •  孤独总比滥情好
    2020-12-23 17:04

    Following @Stepan Vavra's correct answer. A shorter version is:

    - known_hosts:
        name: "{{ item }}"
        key: "{{ lookup('pipe', 'ssh-keyscan {{ item }},`dig +short {{ item }}`') }}"
      with_items:
       - google.com
       - github.com
    

提交回复
热议问题