Files
lilleback-infra/run-playbook.sh
2024-12-28 12:04:44 +01:00

24 lines
610 B
Bash
Executable File

#!/bin/sh
if ! grep -qE "vault_decrypted: true" "./vars/bootstrap.yaml";
then
echo "Decrypt vaults using './decrypt-vault.sh' first!"
exit 1
fi
if ! grep -qE "vault_decrypted: true" "./vars/bigboi.yaml";
then
echo "Decrypt vaults using './decrypt-vault.sh' first!"
exit 1
fi
if ! grep -qE "vault_decrypted: true" "./vars/smolboi.yaml";
then
echo "Decrypt vaults using './decrypt-vault.sh' first!"
exit 1
fi
./helpers/get-passwords.sh
ansible-playbook main.yaml --become-method sudo --extra-vars "ansible_become_pass=$(cat .passwords/bootstrap_become)"
./helpers/delete-passwords.sh