From b33937751157a471f2b55fbca0c7d81cfa30f611 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 7 Jul 2014 23:53:31 +0900 Subject: [PATCH] ansible: check if ansible is installed --- ansible/run.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ansible/run.sh b/ansible/run.sh index d283384..610b77a 100755 --- a/ansible/run.sh +++ b/ansible/run.sh @@ -1,3 +1,11 @@ #!/bin/sh +set -e + +if ! command -v ansible-playbook >/dev/null +then + echo 'Command not found: ansible-playbook' + echo 'Install ansible first.' + exit 1 +fi ansible-playbook -i hosts ansible.yml --ask-sudo-pass