Add integration tests for include_role using variable for tasks_file (#37742)
* Add tests using a variable in tasks_from field Related to #32503 * Do not test using hostvars with import_role hostvars cannot be used with import_role — use include_role instead
This commit is contained in:
parent
c3ab6cb9b1
commit
00068e9fcc
2 changed files with 14 additions and 0 deletions
|
@ -111,6 +111,18 @@
|
|||
vars:
|
||||
where_am_i_defined: "{{ test_var }}"
|
||||
|
||||
- name: Use a variable in tasks_from field
|
||||
include_role:
|
||||
name: role1
|
||||
tasks_from: "{{ tasks_file_name }}.yml"
|
||||
vars:
|
||||
tasks_file_name: canary3
|
||||
|
||||
- name: Assert that tasks file was included
|
||||
assert:
|
||||
that:
|
||||
- role1_canary3 == 'r1c3'
|
||||
|
||||
## FIXME This fails with the following error:
|
||||
## The module {u'include_role': {u'name': u'role1'}} was not found in configured module paths.
|
||||
# - name: Include an entire task
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
- set_fact:
|
||||
role1_canary3: r1c3
|
Loading…
Reference in a new issue