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:
parent
4f3ca9bf23
commit
9fa54a34c7
1 changed files with 3 additions and 1 deletions
4
main.js
4
main.js
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue