---
- name: Populate config host groups
  hosts: all:!yum_server
  connection: local
  gather_facts: false
  tasks:
  - name: Evaluate harbor hosts
    add_host:
      name: "{{ item }}"
      groups: harbor_hosts
    with_items: "{{ groups['k8s-cluster'] }}"
    when: '"registry=harbor" in hostvars[item]["node_labels"]|default("")'
    changed_when: no
