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:
parent
563b73df2f
commit
1b9385ee45
1 changed files with 5 additions and 0 deletions
5
main.js
5
main.js
|
@ -6,6 +6,7 @@ const os = require('os')
|
||||||
async function main() {
|
async function main() {
|
||||||
try {
|
try {
|
||||||
const playbook = core.getInput("playbook", { required: true })
|
const playbook = core.getInput("playbook", { required: true })
|
||||||
|
const requirements = core.getInput("requirements")
|
||||||
const directory = core.getInput("directory")
|
const directory = core.getInput("directory")
|
||||||
const key = core.getInput("key")
|
const key = core.getInput("key")
|
||||||
const inventory = core.getInput("inventory")
|
const inventory = core.getInput("inventory")
|
||||||
|
@ -23,6 +24,10 @@ async function main() {
|
||||||
core.saveState("directory", directory)
|
core.saveState("directory", directory)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (requirements) {
|
||||||
|
await exec.exec("ansible-galaxy", ["install", "-r", requirements])
|
||||||
|
}
|
||||||
|
|
||||||
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 })
|
||||||
|
|
Loading…
Reference in a new issue