Skip to content

Commit

Permalink
support --var-files option
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaopal committed Dec 27, 2017
1 parent d1175b2 commit 6cc002a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions files/npc-playbook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ do_playbook(){
}
echo "$SETUP_PLAYBOOK_YAML">"$SETUP_PLAYBOOK" && ARGS=("${ARGS[@]}" "$SETUP_PLAYBOOK")
;;
--var-files)
local VAR_FILES="$1" && shift
for VAR_FILE in $( IFS=': '
for FILE in $VAR_FILES; do
[ ! -z "$FILE" ] && [ -f "$FILE" ] && echo "$FILE"
done | sort -u ); do
[ ! -z "$VAR_FILE" ] && ARGS=("${ARGS[@]}" -e "@$VAR_FILE")
done
;;
*)
ARGS=("${ARGS[@]}" "$ARG")
;;
Expand Down

0 comments on commit 6cc002a

Please sign in to comment.