From 0415827f08777b8a27a65d9d9ae532710e70ac60 Mon Sep 17 00:00:00 2001 From: Sebastian Haderecker Date: Sat, 13 Apr 2019 00:20:26 +0000 Subject: [PATCH] Check if required packages are installed - Check for ansible, pwgen and jq --- cloud/deploy_ansible_otc_t-pot.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cloud/deploy_ansible_otc_t-pot.sh b/cloud/deploy_ansible_otc_t-pot.sh index c22af498..93e1fd29 100755 --- a/cloud/deploy_ansible_otc_t-pot.sh +++ b/cloud/deploy_ansible_otc_t-pot.sh @@ -1,5 +1,25 @@ #!/bin/bash +# Check if required packages are installed +if ! hash ansible 2>/dev/null; then + echo "Package 'ansible' is missing. Please install it with:" + echo " sudo apt-add-repository --yes --update ppa:ansible/ansible" + echo " sudo apt install ansible" + exit 1 +fi + +if ! hash pwgen 2>/dev/null; then + echo "Package 'pwgen' is missing. Please install it with:" + echo " sudo apt install pwgen" + exit 1 +fi + +if ! hash jq 2>/dev/null; then + echo "Package 'jq' is missing. Please install it with:" + echo " sudo apt install jq" + exit 1 +fi + # Import ECS settings source .ecs_settings.sh