mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
477 B
YAML
20 lines
477 B
YAML
4 years ago
|
- 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
|