dotfiles/.config/yadm/bootstrap
Sergio Laín 885b20e877
⚙️ config(ansible): added ansible and changed a lot of the yadm logic to ansible folder
i still have a lot of work to finish the ansible setup, as well as testing it (the worst part...)
2023-11-19 15:44:53 +01:00

31 lines
936 B
Bash

#!/bin/sh
function have {
command -v "$1" &>/dev/null
}
# Because Git submodule commands cannot operate without a work tree, they must
# be run from within $HOME (assuming this is the root of your dotfiles)
cd "$HOME" || exit
echo "Init submodules"
yadm submodule update --recursive --init
system_type=$(lsb_release -s -d | tr -d '"')
if [[ $system_type == "Arch Linux" ]]; then
have ansible || sudo pacman -S ansible
# Install requirements
ansible-galaxy install -r ~/.config/ansible/requirements.yml
# Install System Tools and Configurations
ansible-playbook -i ~/.config/ansible/inventory ~/.config/ansible/arch.yml --ask-become-pass
elif [[ $system_type == "Debian" ]]; then
have ansible || sudo apt install ansible
# Install requirements
ansible-galaxy install -r ~/.config/yadm/requirements.yml
# Install System Tools and Configurations
ansible-playbook -i ./inventory ./debian.yml --ask-become-pass
fi