- if ! command -v ansible &> /dev/null; then
- echo "ERROR : Ansible not found. Please install."
- exit 1
- fi
-
- #-------------------------------------------------------------------------------
- # Check is yq is installed
- #-------------------------------------------------------------------------------
- if ! command -v yq &> /dev/null; then
- echo "ERROR : yq not found. Please install."
- exit 1
- fi
-
- #-------------------------------------------------------------------------------
- # Check is libvirt is installed
- #-------------------------------------------------------------------------------
- if ! command -v virsh &> /dev/null; then
- echo "ERROR : Libvirt not found. Please install."
- exit 1
- fi
+ for tool in ansible yq virsh; do
+ if ! command -v "$tool" &> /dev/null; then
+ error "$tool not found. Please install."
+ fi
+ done