mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2025-04-19 14:23:33 +00:00
ability to use local inventory file from repo
This commit is contained in:
parent
c4e9ae1206
commit
a4a03e574f
2 changed files with 8 additions and 0 deletions
|
@ -19,6 +19,9 @@ inputs:
|
||||||
inventory:
|
inventory:
|
||||||
description: Custom content to write into hosts
|
description: Custom content to write into hosts
|
||||||
required: false
|
required: false
|
||||||
|
localinventory:
|
||||||
|
description: Inventory file from repo
|
||||||
|
required: false
|
||||||
vault_password:
|
vault_password:
|
||||||
description: The password used for decrypting vaulted files
|
description: The password used for decrypting vaulted files
|
||||||
required: false
|
required: false
|
||||||
|
|
5
main.js
5
main.js
|
@ -64,6 +64,11 @@ async function main() {
|
||||||
cmd.push(inventoryFile)
|
cmd.push(inventoryFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(localinventory) {
|
||||||
|
cmd.push("--inventory-file")
|
||||||
|
cmd.push(localinventory)
|
||||||
|
}
|
||||||
|
|
||||||
if (vaultPassword) {
|
if (vaultPassword) {
|
||||||
const vaultPasswordFile = ".ansible_vault_password"
|
const vaultPasswordFile = ".ansible_vault_password"
|
||||||
fs.writeFileSync(vaultPasswordFile, vaultPassword, { mode: 0600 })
|
fs.writeFileSync(vaultPasswordFile, vaultPassword, { mode: 0600 })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue