fix: update Docker image to pass initial checks
This commit is contained in:
@@ -39,7 +39,7 @@ echo "Bootstrapped PKI at ${INPUT_PKI_CA_URL}"
|
||||
|
||||
# Obtain the Host Certificate
|
||||
[ ! -d ~/.ssh ] && mkdir ~/.ssh
|
||||
echo "@cert-authority *.kraussnet.com $(step ssh config --host --roots)" > ~/.ssh/known_hosts
|
||||
echo "@cert-authority * $(step ssh config --host --roots)" > ~/.ssh/known_hosts
|
||||
echo "Obtained SSH Host Certificate Authority"
|
||||
|
||||
# Obtain a User Certificate for Ansible
|
||||
@@ -55,7 +55,7 @@ ssh-keygen -L -f ~/.ssh/id_ecdsa-cert.pub
|
||||
|
||||
# Process the inventory parameter
|
||||
inventory=""
|
||||
if [ "${INPUT_INVENTORY}" =~ $'\n' ] ; then
|
||||
if [[ "${INPUT_INVENTORY}" =~ $'\n' ]] ; then
|
||||
echo "${INPUT_INVENTORY}" > /tmp/inventory
|
||||
inventory="/tmp/inventory"
|
||||
else
|
||||
@@ -70,7 +70,7 @@ if [ ! -z "${INPUT_REQUIREMENTS:-}" ] ; then
|
||||
fi
|
||||
|
||||
# Change the working directory
|
||||
if [ ! - z "${INPUT_DIRECTORY:-}" ] ; then
|
||||
if [ ! -z "${INPUT_DIRECTORY:-}" ] ; then
|
||||
cd "${INPUT_DIRECTORY}"
|
||||
echo "Changed working directory to $(pwd)"
|
||||
fi
|
||||
@@ -87,10 +87,11 @@ if [ ! -z "${INPUT_CONFIGURATION:-}" ] ; then
|
||||
fi
|
||||
|
||||
# Setup and Run Ansible Playbook
|
||||
cmd=""
|
||||
become="${INPUT_BECOME:-false}"
|
||||
check_mode="${INPUT_CHECK_MODE:-false}"
|
||||
remote_user="${INPUT_REMOTE_USER:-ansible}"
|
||||
|
||||
cmd="-u ${remote_user}"
|
||||
if [ "${become,,}" == "true" ] ; then
|
||||
cmd="${cmd} -b"
|
||||
fi
|
||||
@@ -105,6 +106,6 @@ if [ ! -z "${INPUT_VAULT_PASSWORD:-}" ] ; then
|
||||
fi
|
||||
|
||||
cmd="${cmd} --inventory ${inventory} ${INPUT_PLAYBOOK}"
|
||||
print "Ansible Command: ansible-playbook ${cmd}"
|
||||
echo "Ansible Command: ansible-playbook ${cmd}"
|
||||
|
||||
ansible-playbook $cmd
|
||||
|
||||
Reference in New Issue
Block a user