summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/include_parent_role_vars/tasks/included_by_other_role.yml
blob: 79b7b1cbde8bdaf93f99443eed9c5815c29d09ff (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
34
35
36
37
# Copyright 2019 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

- name: ensure our parent role tree to contain only our direct parent item
  assert:
    that:
      - "ansible_parent_role_names == ['special_vars']"

- name: ensure that ansible_parent_role_paths has the same length as ansible_parent_role_names
  assert:
    that:
      - "ansible_parent_role_names|length == ansible_parent_role_paths|length"

- name: attempt to import ourselves
  import_role:
    name: "include_parent_role_vars"
    tasks_from: "included_by_ourselves.yml"

- name: ensure our parent role tree to contain only our direct parent item after importing
  assert:
    that:
      - "ansible_parent_role_names == ['special_vars']"

- name: attempt to include ourselves
  include_role:
    name: "include_parent_role_vars"
    tasks_from: "included_by_ourselves.yml"

- name: ensure our parent role tree to contain only our direct parent item after including
  assert:
    that:
      - "ansible_parent_role_names == ['special_vars']"

- name: ensure that ansible_parent_role_paths has the same length as ansible_parent_role_names
  assert:
    that:
      - "ansible_parent_role_names|length == ansible_parent_role_paths|length"