Skip tasks for specific site

We have three sites on a DO Droplet.

Two are WP sites, the third is just HTML (for now, anyway).

What I’ve been doing to deploy the HTML only site is to run the deploy command, skipping the WP-dependent tasks associated with two tags:

./bin/ production --skip-tags "deploy-finalize-before,deploy-finalize-after"

I looked at the following thread and imagine that there is a place where I could add a when: is_not_example_site, but am not sure what that command would be or where it would go.

I guess another option would be to modify so that

if [[ "$SITE" = "" ]]
EXTRA_PARAMS="$EXTRA_PARAMS --skip-tags \"deploy-finalize-before,deploy-finalize-after\""

DEPLOY_CMD="ansible-playbook deploy.yml -e env=$ENV -e site=$SITE $EXTRA_PARAMS"

As always, the Roots community wisdom and feedback would be much appreciated.

In terms of the bash command, the above doesn’t quite work.

I had to either change the last line of the script to use eval:


It might be better to use an array to hold the command as referenced in following two threads.

This topic was automatically closed after 42 days. New replies are no longer allowed.