Added check mode
This commit is contained in:
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
@@ -7,9 +7,14 @@ inputs:
|
|||||||
path:
|
path:
|
||||||
description: The playbook's path
|
description: The playbook's path
|
||||||
required: true
|
required: true
|
||||||
|
check_only:
|
||||||
|
description: Whether to only check without changes
|
||||||
|
required: false
|
||||||
|
default: "false"
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: docker
|
using: docker
|
||||||
image: Dockerfile
|
image: Dockerfile
|
||||||
env:
|
env:
|
||||||
INPUT_PATH: ${{ inputs.path }}
|
INPUT_PATH: ${{ inputs.path }}
|
||||||
|
INPUT_CHECK_ONLY: ${{ inputs.check_only }}
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
#!/usr/bin/env ash
|
#!/usr/bin/env ash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
ansible-playbook "$INPUT_PATH" -vv
|
|
||||||
|
if [ "$INPUT_CHECK_ONLY" = "true" ]; then
|
||||||
|
ANSIBLE_OPTIONS="--check --diff"
|
||||||
|
fi;
|
||||||
|
|
||||||
|
ansible-playbook "$INPUT_PATH" -vv "$ANSIBLE_OPTIONS"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user