ansible/test/integration/targets/lookup_inventory_hostnames/main.yml
Sloane Hertel afb5e02c19 preserve same order as inventory manager when using host lookup (#55331)
* preserve same order as inventory manager when using inventory_hostnames lookup

add a test

* move generic code
2019-04-18 15:54:03 -04:00

13 lines
254 B
YAML

---
- hosts: localhost
gather_facts: no
tasks:
- set_fact:
hosts_a: "{{ lookup('inventory_hostnames', 'group01', wantlist=true) }}"
- set_fact:
hosts_b: "{{ groups['group01'] }}"
- assert:
that:
- hosts_a == hosts_b