1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

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:
Sam Doran 2018-03-23 15:43:00 -04:00 committed by GitHub
parent c3ab6cb9b1
commit 00068e9fcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View file

@ -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

View file

@ -0,0 +1,2 @@
- set_fact:
role1_canary3: r1c3