deploy.sh check fait la --syntax-check et peut être utilisé avec l'argument local

This commit is contained in:
southerntofu 2020-04-15 13:37:47 +00:00
parent c7c790e608
commit 49fa247792
1 changed files with 12 additions and 8 deletions

View File

@ -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