#!/bin/bash set -eu getaddr() { awk -v "name=$1" '$1 == name { print $2 }' "$hosts_in" | sed 's/ansible_ssh_host=//' } mkhosts() { cat < hosts.tmp ansible-playbook \ -i hosts.tmp \ ick2.yml \ -e qvisqve_domain="$(getaddr ick)" \ -e controller_domain="$(getaddr ick)" \ -e artifact_store_domain="$(getaddr ick)" \ -e apt_domain="$(getaddr ick)" \ -e notify_domain="$(getaddr ick)" \ "$@"