# created by CORD ansible role: prep-kubespray/templates/kubespray_inventory.j2

[cord-headnodes]
{% for node in groups['head'] %}
{% set npi = ( physical_node_list | selectattr("name", "equalto", node) | first ) %}
{{ node }} ip='{{ management_net_cidr | ipaddr(npi.ipv4_last_octet) |  ipaddr("address")  }}'
{% endfor %}

[cord-computenodes]
{% for node in groups['compute'] %}
{% set npi = ( physical_node_list | selectattr("name", "equalto", node) | first ) %}
{{ node }} ip='{{ management_net_cidr | ipaddr(npi.ipv4_last_octet) |  ipaddr("address")  }}'
{% endfor %}

[kube-master:children]
cord-headnodes
cord-computenodes

[etcd:children]
cord-headnodes
cord-computenodes

[kube-node:children]
cord-headnodes
cord-computenodes

[k8s-cluster:children]
kube-node
kube-master

[calico-rr]
