mirror of
https://github.com/dawidd6/action-ansible-playbook.git
synced 2024-12-27 10:36:09 -07:00
main: support installing requirements
This commit is contained in:
parent
563b73df2f
commit
1b9385ee45
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 New Issue
Block a user