From 49fa2477925cf7bcf5add834e9a25852481ba979 Mon Sep 17 00:00:00 2001 From: southerntofu Date: Wed, 15 Apr 2020 13:37:47 +0000 Subject: [PATCH] =?UTF-8?q?deploy.sh=20check=20fait=20la=20--syntax-check?= =?UTF-8?q?=20et=20peut=20=C3=AAtre=20utilis=C3=A9=20avec=20l'argument=20l?= =?UTF-8?q?ocal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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