1
0
Fork 0
mirror of https://github.com/dawidd6/action-ansible-playbook.git synced 2024-11-22 15:32:18 +00:00

main: support installing requirements

This commit is contained in:
Dawid Dziurla 2020-12-06 17:06:02 +01:00
parent 563b73df2f
commit 1b9385ee45
No known key found for this signature in database
GPG key ID: 7B6D8368172E9B0B

View file

@ -6,6 +6,7 @@ const os = require('os')
async function main() {
try {
const playbook = core.getInput("playbook", { required: true })
const requirements = core.getInput("requirements")
const directory = core.getInput("directory")
const key = core.getInput("key")
const inventory = core.getInput("inventory")
@ -23,6 +24,10 @@ async function main() {
core.saveState("directory", directory)
}
if (requirements) {
await exec.exec("ansible-galaxy", ["install", "-r", requirements])
}
if (key) {
const keyFile = ".ansible_key"
fs.writeFileSync(keyFile, key + os.EOL, { mode: 0600 })