[Ansible] 將 public key 加入 known hosts

SSH RSA key fingerprint

在使用 Ansible 部署時,常常會需要使用到 git clone 或 scp 等方式,透過 ssh 去另一台主機抓取專案程式碼或檔案,平常如果是手動在一台全新的機器第一次使用 ssh 連線,通常會跳出詢問對話:

$ git clone git@github.com:SarsTW/Learn-Git-in-30-days.git
Cloning into 'Learn-Git-in-30-days'...
The authenticity of host 'github.com (192.30.252.120)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?