Skip to content

Commit

Permalink
Pass extra variables to playbooks
Browse files Browse the repository at this point in the history
Allow extra variables to be passed to database and uploads playbook commands
  • Loading branch information
dalepgrant authored Jul 30, 2021
1 parent 6532a9b commit c4d01e8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bin/sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ do
[[ $arg = -h ]] && { show_usage; exit 0; }
done

ENV="$1";
SITE="$2";
TYPE="$3";
MODE="$4";
ENV="$1"; shift
SITE="$1"; shift
TYPE="$1"; shift
MODE="$1"; shift
EXTRA_PARAMS=$@

# allow use of abbreviations of environments
if [[ $ENV = p || $ENV = prod ]]; then
Expand All @@ -65,8 +66,8 @@ elif [[ $MODE = up ]]; then
MODE="push"
fi

DATABASE_CMD="ansible-playbook database.yml -e env=$ENV -e site=$SITE -e mode=$MODE"
UPLOADS_CMD="ansible-playbook uploads.yml -e env=$ENV -e site=$SITE -e mode=$MODE"
DATABASE_CMD="ansible-playbook database.yml -e env=$ENV -e site=$SITE -e mode=$MODE $EXTRA_PARAMS"
UPLOADS_CMD="ansible-playbook uploads.yml -e env=$ENV -e site=$SITE -e mode=$MODE $EXTRA_PARAMS"

HOSTS_FILE="hosts/$ENV"

Expand Down

0 comments on commit c4d01e8

Please sign in to comment.