diff --git a/dotfiles/desktop/.bashrc.d/50-ap.sh b/dotfiles/desktop/.bashrc.d/50-ap.sh new file mode 100755 index 0000000..c9bc68e --- /dev/null +++ b/dotfiles/desktop/.bashrc.d/50-ap.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +ap() { + export PLAYBOOK_DIR="${PLAYBOOK_DIR:-$HOME/AnsiblePlaybook}" + + local cmd=(ansible-playbook "$PLAYBOOK_DIR/ansible/site.yml" -l "$HOSTNAME" -K) + + if [ -n "$1" ]; then + cmd+=(--tag "$1") + fi + + printf '+ %s\n' "${cmd[*]}" + "${cmd[@]}" +}