1---
2- name: Collect all cli test cases
3  find:
4    paths: '{{ role_path }}/tests/cli'
5    patterns: '{{ testcase }}.yaml'
6    use_regex: true
7  register: test_cases
8  delegate_to: localhost
9
10- name: Set test_items
11  set_fact: test_items="{{ test_cases.files | map(attribute='path') | list }}"
12  delegate_to: localhost
13
14- name: Run test case (connection=ansible.netcommon.network_cli)
15  include: '{{ test_case_to_run }}'
16  vars:
17    ansible_connection: ansible.netcommon.network_cli
18  with_items: '{{ test_items }}'
19  loop_control:
20    loop_var: test_case_to_run
21