ansible/test/integration/targets/collections/test_bypass_host_loop.yml
Matt Martz be5fc4e642
Ensure we call action_loader.get with collection_list (#72206)
* Ensure we call action_loader.get with collection_list. Fixes #72170

* Add tests and changelog

* Remove grep, do assertion in playbook. ci_complete

* Skip old jinja2 versions

* ci_complete

* dedupe
2020-10-19 09:54:24 -05:00

22 lines
625 B
YAML

- name: Test collection lookup bypass host list
hosts: all
connection: local
gather_facts: false
collections:
- testns.testcoll
tasks:
- meta: end_host
when: lookup('pipe', ansible_playbook_python ~ ' -c "import jinja2; print(jinja2.__version__)"') is version('2.7', '<')
- 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