#!/bin/bash set -euo pipefail (cd .. && terraform output -json) | jq 'to_entries|map({(.key|tostring):.value.value})|add as $input | $input.k8s_node_ips|to_entries|map({("k8s-node"+(.key|tostring)):{ansible_host:.value}})|add + {"k8s-master":{ansible_host:$input.k8s_master_ip}}|{_meta:{hostvars:.}, all:(["k8s-master"] + ($input.k8s_node_ips|to_entries|map("k8s-node"+(.key|tostring)))) }'