summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/roles/testrole_main_yaml/tasks/main.yml
blob: 31e3af5e4f2fc91ef863411f11db52942178f449 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
- name: check collections list from role meta
  plugin_lookup:
  register: pluginlookup_out

- name: call role-local ping module
  ping:
  register: ping_out

- name: call unqualified module in another collection listed in role meta (testns.coll_in_sys)
  systestmodule:
  register: systestmodule_out

# verify that pluginloader caching doesn't prevent us from explicitly calling a builtin plugin with the same name
- name: call builtin ping module explicitly
  ansible.builtin.ping:
  register: builtinping_out

- debug:
    msg: '{{ test_role_input | default("(undefined)") }}'
  register: test_role_output

- set_fact:
    testrole_source: collection

# FIXME: add tests to ensure that block/task level stuff in a collection-hosted role properly inherit role default/meta values

- assert:
    that:
    - pluginlookup_out.collection_list == ['testns.testcoll', 'ansible.builtin', 'testns.coll_in_sys', 'bogus.fromrolemeta']
    - ping_out.source is defined and ping_out.source == 'user'
    - systestmodule_out.source is defined and systestmodule_out.source == 'sys'
    - builtinping_out.ping is defined and builtinping_out.ping == 'pong'
    - test_role_input is not defined or test_role_input == test_role_output.msg