Managing Dotfiles with Ansible | The Broken Link

PHOTO EMBED

Wed Mar 03 2021 04:09:21 GMT+0000 (UTC)

Saved by @faisalhumayun #bash #ansible

#!/usr/bin/env bash

set -e

# Dotfiles' project root directory
ROOTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Host file location
HOSTS="$ROOTDIR/hosts"
# Main playbook
PLAYBOOK="$ROOTDIR/dotfiles.yml"

# Installs ansible
apt-get update && apt-get install -y ansible

# Runs Ansible playbook using our user.
ansible-playbook -i "$HOSTS" "$PLAYBOOK" --ask-become-pass

exit 0
content_copyCOPY

https://thebroken.link/managing-dotfiles-with-ansible/