mirror of
https://github.com/fscotto/infra.git
synced 2026-05-30 15:39:58 +00:00
19 lines
309 B
Bash
Executable File
19 lines
309 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 '\033[0;36m+ %s\033[0m\n' "${cmd[*]}"
|
|
"${cmd[@]}"
|
|
)
|
|
}
|