#!/bin/bash
set -euxo pipefail

# env
CONFIG_DIR=${HOME}/.config
MF_DIR=${CONFIG_DIR}/mf

# apt
sudo apt update
sudo apt install -y \
  python3-pip \
  python3-venv \
  git \
  git-lfs 

# pip/venv
python3 -m venv "${MF_DIR}"/venv
"${MF_DIR}"/venv/bin/python3 -m pip install ansible

# run
pushd "${MF_DIR}" || exit
"${MF_DIR}"/venv/bin/ansible-playbook main.yml --ask-become-pass
popd || exit

mkdir -p "${HOME}"/git
cd "${HOME}"/git
ln -s "${HOME}"/.config/mf
