k8s-master ansible_host=${master} %{ for index, ip in nodes ~} k8s-node${index} ansible_host=${ip} %{ endfor ~} [k8s-nodes] %{ for index, ip in nodes ~} k8s-node${index} %{ endfor ~}