add ansible playbook setup

This commit is contained in:
Alexander Navarro 2025-07-21 11:57:03 -04:00
parent 78bfbc3ed6
commit b6eea93564
9 changed files with 196 additions and 14 deletions

29
bootstrap/bootstrap.sh Executable file
View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -eou pipefail
export ANSIBLE_STDOUT_CALLBACK=minimal
if ! command -v uv >/dev/null 2>&1; then
echo -e "Installing UV...\n"
curl -LsSf https://astral.sh/uv/install.sh | sh
fi
echo -e "Executing playbook...\n"
if [[ -d ~/.config/dotfiles ]]; then
pushd ~/.config/dotfiles/bootstrap/ || exit
# dotfiles are cloned, executed localy
uvx --from ansible ansible-playbook --ask-become-pass bootstrap.yaml
else
# dotfiles are not cloned, executed remotly
uvx --from ansible ansible-pull --ask-become-pass --url ssh://git@git.alecodes.page:24062/alecodes/dots.git bootstrap/bootstrap.yaml
fi
popd || exit
echo -e "Done!\n"