mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-12-09 14:20:42 -07:00
Add support for SSH Host Key Checking
By default it seems that SSH host key checking has been disabled. This patch makes it optional. If a variable named known_hosts is passed in, the key checking will be enabled. The variable should contain the complete contents of the known_hosts file, which must contain the public key(s) of the host(s) in the inventory.
This commit is contained in:
5
post.js
5
post.js
@@ -14,6 +14,7 @@ async function main() {
|
||||
const keyFile = core.getState("keyFile")
|
||||
const inventoryFile = core.getState("inventoryFile")
|
||||
const vaultPasswordFile = core.getState("vaultPasswordFile")
|
||||
const knownHostsFile = core.getState("knownHostsFile")
|
||||
|
||||
if (directory)
|
||||
process.chdir(directory)
|
||||
@@ -26,6 +27,10 @@ async function main() {
|
||||
|
||||
if (vaultPasswordFile)
|
||||
rm(vaultPasswordFile)
|
||||
|
||||
if (knownHostsFile)
|
||||
rm(knownHostsFile)
|
||||
|
||||
} catch (error) {
|
||||
core.setFailed(error.message)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user