add ansible playbook setup
This commit is contained in:
parent
78bfbc3ed6
commit
c01fe6acce
9 changed files with 184 additions and 14 deletions
27
bootstrap/bootstrap.sh
Executable file
27
bootstrap/bootstrap.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
|||
#!/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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue