add ansible playbook setup

This commit is contained in:
Alexander Navarro 2025-07-21 11:57:03 -04:00
parent 78bfbc3ed6
commit ba324fa3c4
3 changed files with 131 additions and 0 deletions

25
bootstrap/bootstrap.sh Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
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 --with ansible --from ansible-core ansible-playbook --ask-become-pass bootstrap.yaml
else
# dotfiles are not cloned, executed remotly
uvx --with ansible --from ansible-core 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"