summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/collections/test_bypass_host_loop.yml
blob: 71f48d5e30f78b7aa6a95fa9b33534d6ccd74509 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
- name: Test collection lookup bypass host list
  hosts: all
  connection: local
  gather_facts: false
  collections:
    - testns.testcoll
  tasks:
    - bypass_host_loop:
      register: bypass

    - run_once: true
      vars:
        bypass_hosts: '{{ hostvars|dictsort|map(attribute="1.bypass.bypass_inventory_hostname")|select("defined")|unique }}'
      block:
        - debug:
            var: bypass_hosts

        - assert:
            that: bypass_hosts|length == 1