5 Commits

Author SHA1 Message Date
obbiondo
03f941b221 Add sudo option for root access (#16)
Co-authored-by: ANDREA BIONDO s291512 <s291512@studenti.polito.it>
Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
2021-07-19 17:49:48 +02:00
Dawid Dziurla
f0b38f33e9 Merge pull request #21 from dawidd6/dependabot-add-v2-config-file
Upgrade to GitHub-native Dependabot
2021-04-29 07:40:46 +02:00
dependabot-preview[bot]
75ae627236 Upgrade to GitHub-native Dependabot 2021-04-28 22:30:47 +00:00
Dawid Dziurla
69990b93b4 Merge pull request #20 from dawidd6/dependabot-npm_and_yarn-actions-core-1.2.7
build(deps): bump @actions/core from 1.2.6 to 1.2.7
2021-04-14 09:14:00 +02:00
dependabot-preview[bot]
3c219bf69c build(deps): bump @actions/core from 1.2.6 to 1.2.7
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.6 to 1.2.7.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-14 04:54:38 +00:00
5 changed files with 34 additions and 9 deletions

18
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "04:00"
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
time: "04:00"
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 10

View File

@@ -28,6 +28,9 @@ inputs:
options: options:
description: Extra options that should be passed to ansible-playbook command description: Extra options that should be passed to ansible-playbook command
required: false required: false
sudo:
description: Set to "true" if root is required for running your playbook
required: false
runs: runs:
using: node12 using: node12
main: main.js main: main.js

View File

@@ -14,6 +14,7 @@ async function main() {
const vaultPassword = core.getInput("vault_password") const vaultPassword = core.getInput("vault_password")
const knownHosts = core.getInput("known_hosts") const knownHosts = core.getInput("known_hosts")
const options = core.getInput("options") const options = core.getInput("options")
const sudo = core.getInput("sudo")
let cmd = ["ansible-playbook", playbook] let cmd = ["ansible-playbook", playbook]
@@ -81,10 +82,13 @@ async function main() {
process.env.ANSIBLE_HOST_KEY_CHECKING = "False" process.env.ANSIBLE_HOST_KEY_CHECKING = "False"
} }
if (sudo) {
cmd.unshift("sudo")
}
process.env.ANSIBLE_FORCE_COLOR = "True" process.env.ANSIBLE_FORCE_COLOR = "True"
await exec.exec(cmd.join(' ')) await exec.exec(cmd.join(' '))
} catch (error) { } catch (error) {
core.setFailed(error.message) core.setFailed(error.message)
} }

14
package-lock.json generated
View File

@@ -5,15 +5,15 @@
"packages": { "packages": {
"": { "": {
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.7",
"@actions/exec": "^1.0.4", "@actions/exec": "^1.0.4",
"yaml": "^1.10.2" "yaml": "^1.10.2"
} }
}, },
"node_modules/@actions/core": { "node_modules/@actions/core": {
"version": "1.2.6", "version": "1.2.7",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.7.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" "integrity": "sha512-kzLFD5BgEvq6ubcxdgPbRKGD2Qrgya/5j+wh4LZzqT915I0V3rED+MvjH6NXghbvk1MXknpNNQ3uKjXSEN00Ig=="
}, },
"node_modules/@actions/exec": { "node_modules/@actions/exec": {
"version": "1.0.4", "version": "1.0.4",
@@ -39,9 +39,9 @@
}, },
"dependencies": { "dependencies": {
"@actions/core": { "@actions/core": {
"version": "1.2.6", "version": "1.2.7",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.7.tgz",
"integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==" "integrity": "sha512-kzLFD5BgEvq6ubcxdgPbRKGD2Qrgya/5j+wh4LZzqT915I0V3rED+MvjH6NXghbvk1MXknpNNQ3uKjXSEN00Ig=="
}, },
"@actions/exec": { "@actions/exec": {
"version": "1.0.4", "version": "1.0.4",

View File

@@ -2,7 +2,7 @@
"name": "action-ansible-playbook", "name": "action-ansible-playbook",
"main": "main.js", "main": "main.js",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.6", "@actions/core": "^1.2.7",
"@actions/exec": "^1.0.4", "@actions/exec": "^1.0.4",
"yaml": "^1.10.2" "yaml": "^1.10.2"
} }