Add second arg for DebOps playbook function

This commit is contained in:
Jeremy Gardais 2022-03-28 09:17:57 +02:00
parent b23a2edbde
commit 26b770959d
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 10 additions and 2 deletions

12
zshrc
View File

@ -1026,7 +1026,11 @@ function debservice() {
## Apply a playbook to a define host(s)/group(s) {{{ ## Apply a playbook to a define host(s)/group(s) {{{
function debplay() { function debplay() {
if [ ${ANS_HOST} ]; then if [ ${ANS_HOST} ]; then
debops run "${1:-/dev/null}" --limit "${ANS_HOST}" if [ ! ${2} ]; then
debops run "${1:-/dev/null}" --limit "${ANS_HOST}"
else
debops run "${1:-/dev/null}" --limit "${ANS_HOST}" --tags "role::${2:-/dev/null}"
fi
else else
printf '%b' "${MAGENTA}ANS_HOST${RESET} vars is ${REDB}not${RESET} define!\n" printf '%b' "${MAGENTA}ANS_HOST${RESET} vars is ${REDB}not${RESET} define!\n"
fi fi
@ -1072,7 +1076,11 @@ function debcservice() {
## Check a playbook to a define host(s)/group(s) {{{ ## Check a playbook to a define host(s)/group(s) {{{
function debcplay() { function debcplay() {
if [ ${ANS_HOST} ]; then if [ ${ANS_HOST} ]; then
debops check "${1:-/dev/null}" --limit "${ANS_HOST}" if [ ! ${2} ]; then
debops run "${1:-/dev/null}" --limit "${ANS_HOST}"
else
debops run "${1:-/dev/null}" --limit "${ANS_HOST}" --tags "role::${2:-/dev/null}"
fi
else else
printf '%b' "${MAGENTA}ANS_HOST${RESET} vars is ${REDB}not${RESET} define!\n" printf '%b' "${MAGENTA}ANS_HOST${RESET} vars is ${REDB}not${RESET} define!\n"
fi fi