diff --git a/deploy.sh b/deploy.sh index c4952e4..7d62039 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,10 +1,14 @@ #!/bin/bash -if [[ $1 = "test" ]]; then - ansible-playbook --check -i hosts recette.yml -elif [[ $1 = "local" ]]; then - ansible-playbook --connection=local --inventory 127.0.0.1, --limit 127.0.0.1 \ - recette.yml -i hosts -else - ansible-playbook -i hosts recette.yml -fi +CMD="ansible-playbook -i hosts recette.yml" + +for arg in "$@"; do + if [[ $arg = "local" ]]; then + CMD="$CMD --connection=local --inventory 127.0.0.1, --limit 127.0.0.1" + fi + if [[ $arg = "check" ]]; then + CMD="$CMD --syntax-check" + fi +done + +eval $CMD