{% for host in groups['kube-node'] %} {% if hostvars[host]['access_ip'] is defined %} {% if hostvars[host]['node_pod_cidr'] != node_pod_cidr %} {{ hostvars[host]['node_pod_cidr'] }} via {{ hostvars[host]['access_ip'] }} {% endif %} {% endif %} {% endfor %}