Fixed stuff
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -0,0 +1 @@
|
||||
.idea
|
||||
10
Dockerfile
10
Dockerfile
@@ -4,16 +4,14 @@ FROM public.ecr.aws/docker/library/node:22-alpine3.20
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
|
||||
# Install git for gitea actions and ansible
|
||||
RUN <<EOF
|
||||
set -e
|
||||
apk add --no-cache bash curl python3 pipx git rsync unzip openssh
|
||||
pipx install --include-deps ansible
|
||||
EOF
|
||||
RUN apk add --no-cache bash curl python3 pipx git rsync unzip openssh
|
||||
RUN pipx install --include-deps ansible
|
||||
|
||||
ENV PY_COLOR="1"
|
||||
ENV ANSIBLE_FORCE_COLOR="1"
|
||||
|
||||
WORKDIR /usr/src
|
||||
COPY entrypoint.sh .
|
||||
|
||||
RUN chmod +x /usr/src/entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["ash","-c","/usr/src/entrypoint.sh"]
|
||||
|
||||
@@ -4,10 +4,10 @@ author: Skydust
|
||||
|
||||
# Define your inputs here.
|
||||
inputs:
|
||||
path:
|
||||
playbook:
|
||||
description: The playbook's path
|
||||
required: true
|
||||
check_only:
|
||||
only_check:
|
||||
description: Whether to only check without changes
|
||||
required: false
|
||||
default: "false"
|
||||
@@ -15,6 +15,3 @@ inputs:
|
||||
runs:
|
||||
using: docker
|
||||
image: Dockerfile
|
||||
env:
|
||||
INPUT_PATH: ${{ inputs.path }}
|
||||
INPUT_CHECK_ONLY: ${{ inputs.check_only }}
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
#!/usr/bin/env ash
|
||||
|
||||
INPUT_PLAYBOOK_PATH="$playbook"
|
||||
INPUT_ONLY_CHECK="$only_check"
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$INPUT_CHECK_ONLY" = "true" ]; then
|
||||
ANSIBLE_OPTIONS="--check --diff"
|
||||
ANSIBLE_OPTIONS="-vv"
|
||||
|
||||
if [ "$INPUT_ONLY_CHECK" = "true" ]; then
|
||||
ANSIBLE_OPTIONS="${ANSIBLE_OPTIONS} --check --diff"
|
||||
fi;
|
||||
|
||||
ansible-playbook "$INPUT_PATH" -vv "$ANSIBLE_OPTIONS"
|
||||
echo "Running playbook with options: ansible-playbook $ANSIBLE_OPTIONS \"$INPUT_PLAYBOOK_PATH\""
|
||||
ansible-playbook $ANSIBLE_OPTIONS "$INPUT_PLAYBOOK_PATH"
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user