1
0
Fork 0
mirror of https://github.com/dawidd6/action-ansible-playbook.git synced 2024-12-23 04:37:29 +00:00

main: save filenames in state

This commit is contained in:
Dawid Dziurla 2020-05-07 11:41:33 +02:00
parent 4f3ca9bf23
commit 9fa54a34c7
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B

View file

@ -2,7 +2,6 @@ const core = require('@actions/core')
const exec = require('@actions/exec')
const fs = require('fs')
const os = require('os')
const path = require('path')
async function main() {
try {
@ -26,6 +25,7 @@ async function main() {
if (key) {
const keyFile = ".ansible_key"
fs.writeFileSync(keyFile, key + os.EOL, { mode: 0600 })
core.saveState("keyFile", keyFile)
cmd.push("--key-file")
cmd.push(keyFile)
}
@ -33,6 +33,7 @@ async function main() {
if (inventory) {
const inventoryFile = ".ansible_inventory"
fs.writeFileSync(inventoryFile, inventory, { mode: 0600 })
core.saveState("inventoryFile", inventoryFile)
cmd.push("--inventory-file")
cmd.push(inventoryFile)
}
@ -40,6 +41,7 @@ async function main() {
if (vaultPassword) {
const vaultPasswordFile = ".ansible_vault_password"
fs.writeFileSync(vaultPasswordFile, vaultPassword, { mode: 0600 })
core.saveState("vaultPasswordFile", vaultPasswordFile)
cmd.push("--vault-password-file")
cmd.push(vaultPasswordFile)
}