main: simplify known hosts logic

This commit is contained in:
Dawid Dziurla 2021-07-26 20:24:44 +02:00 committed by GitHub
parent 90a22da2b0
commit e959e707d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,14 +69,7 @@ async function main() {
const knownHostsFile = ".ansible_known_hosts" const knownHostsFile = ".ansible_known_hosts"
fs.writeFileSync(knownHostsFile, knownHosts, { mode: 0600 }) fs.writeFileSync(knownHostsFile, knownHosts, { mode: 0600 })
core.saveState("knownHostsFile", knownHostsFile) core.saveState("knownHostsFile", knownHostsFile)
let known_hosts_param = [ cmd.push("--ssh-common-args", `-o UserKnownHostsFile=${knownHostsFile}`)
"--ssh-common-args=",
"\"",
"-o UserKnownHostsFile=",
knownHostsFile,
"\""
].join('')
cmd.push(known_hosts_param)
process.env.ANSIBLE_HOST_KEY_CHECKING = "True" process.env.ANSIBLE_HOST_KEY_CHECKING = "True"
} else { } else {
process.env.ANSIBLE_HOST_KEY_CHECKING = "False" process.env.ANSIBLE_HOST_KEY_CHECKING = "False"