1
0
Fork 0
mirror of https://github.com/dawidd6/action-ansible-playbook.git synced 2024-11-26 10:17:50 +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 exec = require('@actions/exec')
const fs = require('fs') const fs = require('fs')
const os = require('os') const os = require('os')
const path = require('path')
async function main() { async function main() {
try { try {
@ -26,6 +25,7 @@ async function main() {
if (key) { if (key) {
const keyFile = ".ansible_key" const keyFile = ".ansible_key"
fs.writeFileSync(keyFile, key + os.EOL, { mode: 0600 }) fs.writeFileSync(keyFile, key + os.EOL, { mode: 0600 })
core.saveState("keyFile", keyFile)
cmd.push("--key-file") cmd.push("--key-file")
cmd.push(keyFile) cmd.push(keyFile)
} }
@ -33,6 +33,7 @@ async function main() {
if (inventory) { if (inventory) {
const inventoryFile = ".ansible_inventory" const inventoryFile = ".ansible_inventory"
fs.writeFileSync(inventoryFile, inventory, { mode: 0600 }) fs.writeFileSync(inventoryFile, inventory, { mode: 0600 })
core.saveState("inventoryFile", inventoryFile)
cmd.push("--inventory-file") cmd.push("--inventory-file")
cmd.push(inventoryFile) cmd.push(inventoryFile)
} }
@ -40,6 +41,7 @@ async function main() {
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 })
core.saveState("vaultPasswordFile", vaultPasswordFile)
cmd.push("--vault-password-file") cmd.push("--vault-password-file")
cmd.push(vaultPasswordFile) cmd.push(vaultPasswordFile)
} }