From c848364cc887bd0aa5cf6ba423f192cbb243fc5d Mon Sep 17 00:00:00 2001 From: southerntofu Date: Wed, 15 Apr 2020 20:19:35 +0000 Subject: [PATCH] ./deploy.sh debug :) --- deploy.sh | 12 +++++++++--- docs/administrateurice.md | 5 +++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/deploy.sh b/deploy.sh index 270a728..2d2bafe 100755 --- a/deploy.sh +++ b/deploy.sh @@ -2,17 +2,23 @@ CMD="ANSIBLE_RETRY_FILES_ENABLED=0 ansible-playbook recette.yml" -if [[ $# = 0 ]]; then - CMD="$CMD --connection=local --inventory 127.0.0.1, --limit 127.0.0.1" -fi +REMOTE=false for arg in "$@"; do if [[ $arg = "remote" ]]; then + REMOTE=true CMD="$CMD -i hosts" fi if [[ $arg = "check" ]]; then CMD="$CMD --syntax-check" fi + if [[ $arg = "debug" ]]; then + CMD="$CMD -vvv" + fi done +if [[ $REMOTE = false ]]; then + CMD="$CMD --connection=local --inventory 127.0.0.1, --limit 127.0.0.1" +fi + eval $CMD diff --git a/docs/administrateurice.md b/docs/administrateurice.md index 07bcdbd..d4fe40d 100644 --- a/docs/administrateurice.md +++ b/docs/administrateurice.md @@ -98,10 +98,11 @@ user@client:~/infra $ ./deploy.sh remote root@server:~/infra $ ./deploy.sh ``` -Additionnellement, deploy.sh accepte un argument `check` qui déclenche une simple vérification de la syntaxe Ansible. En résumé : +Additionnellement, deploy.sh accepte un argument `check` qui déclenche une simple vérification de la syntaxe Ansible. Enfin, la commande accepte également un argument `debug` qui envoie "-vvv" à Ansible. En résumé : ``` -deploy.sh [remote|check] [remote|check] +deploy.sh [remote|check|debug] .. check: vérifie la syntaxe ansible remote: applique la recette sur un serveur distant (défini dans ./hosts) + debug: active le debug de ansible ```