Files
infra/dotfiles/desktop/.bashrc.d/50-ap.sh
2026-04-15 19:22:47 +02:00

19 lines
292 B
Bash
Executable File

#!/bin/bash
ap() {
export PLAYBOOK_DIR="${PLAYBOOK_DIR:-$HOME/AnsiblePlaybook}"
(
cd "$PLAYBOOK_DIR"
local cmd=(ansible-playbook ansible/site.yml -l "$HOSTNAME" -K)
if [ -n "$1" ]; then
cmd+=(--tag "$1")
fi
printf '+ %s\n' "${cmd[*]}"
"${cmd[@]}"
)
}