From 26b770959df7353961a335eb97ad23e516e65b1b Mon Sep 17 00:00:00 2001 From: Gardouille Date: Mon, 28 Mar 2022 09:17:57 +0200 Subject: [PATCH] Add second arg for DebOps playbook function --- zshrc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/zshrc b/zshrc index d3edeb2..d5dd1fd 100644 --- a/zshrc +++ b/zshrc @@ -1026,7 +1026,11 @@ function debservice() { ## Apply a playbook to a define host(s)/group(s) {{{ function debplay() { 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 printf '%b' "${MAGENTA}ANS_HOST${RESET} vars is ${REDB}not${RESET} define !\n" fi @@ -1072,7 +1076,11 @@ function debcservice() { ## Check a playbook to a define host(s)/group(s) {{{ function debcplay() { 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 printf '%b' "${MAGENTA}ANS_HOST${RESET} vars is ${REDB}not${RESET} define !\n" fi