edit the host-ansible-conf helper scripts to use envvar instead of the templated var

This commit is contained in:
Curt Spark 2024-03-25 17:58:10 +00:00
parent e33bd3e90c
commit 711b81dd99
2 changed files with 4 additions and 2 deletions

View File

@ -116,6 +116,8 @@ fi
export PATH="/usr/sbin:${PATH}" export PATH="/usr/sbin:${PATH}"
export ANSIBLECONF_DIR="{{ ansibleconf_directory }}"
export EDITOR=vim export EDITOR=vim
# To fix weird terminal behaviour when in SSH # To fix weird terminal behaviour when in SSH

View File

@ -25,14 +25,14 @@ if [ -e $USBKEYVAR ]; then
fi fi
if [[ "$FILENAME" == *"server"* ]]; then if [[ "$FILENAME" == *"server"* ]]; then
echo "Detected as a server playbook file, decrypting accordingly..." echo "Detected as a server playbook file, decrypting accordingly..."
if ansible-playbook -e @{{ ansibleconf_directory }}/serversecrets.enc --vault-password-file $USBKEYSLOCATION/serversecrets $ABSOLUTELOCATION; then if ansible-playbook -e @$ANSIBLECONF_DIR/serversecrets.enc --vault-password-file $USBKEYSLOCATION/serversecrets $ABSOLUTELOCATION; then
echo "Ansible Playbook success!" echo "Ansible Playbook success!"
else else
echo "Ansible Playbook failure!" echo "Ansible Playbook failure!"
fi fi
elif [[ "$FILENAME" == *"service"* ]]; then elif [[ "$FILENAME" == *"service"* ]]; then
echo "Detected as a service playbook file, decrypting accordingly..." echo "Detected as a service playbook file, decrypting accordingly..."
if ansible-playbook -e @{{ ansibleconf_directory }}/serversecrets.enc --vault-password-file $USBKEYSLOCATION/serversecrets -e @{{ ansibleconf_directory }}/services/$FILEPARENTDIR/servicesecrets.enc --vault-password-file $USBKEYSLOCATION/servicesecrets $ABSOLUTELOCATION; then if ansible-playbook -e @$ANSIBLECONF_DIR/serversecrets.enc --vault-password-file $USBKEYSLOCATION/serversecrets -e @$ANSIBLECONF_DIR/services/$FILEPARENTDIR/servicesecrets.enc --vault-password-file $USBKEYSLOCATION/servicesecrets $ABSOLUTELOCATION; then
echo "Ansible Playbook success!" echo "Ansible Playbook success!"
else else
echo "Ansible Playbook failure!" echo "Ansible Playbook failure!"