mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-12-23 04:37:29 +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() {
|
||||
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 })
|
||||
|
|
Loading…
Reference in a new issue