27 lines
625 B
Bash
Executable file
27 lines
625 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eou pipefail
|
|
|
|
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 -v 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"
|