#!/bin/bash set -eu hosts_in="$1" shift 1 getip() { awk -v "name=$1" '$1 == name { print $2 }' "$hosts_in" } mkhosts() { cat < hosts.tmp ansible-playbook -i hosts.tmp ick-cluster.yml \ -e "qvisqve_domain=$(getip qvisqve)" \ -e "controller_domain=$(getip controller)" \ -e "artifact_store_domain=$(getip artifacts)" \ -e "apt_domain=$(getip apt)" \ "$@"