mirror of https://github.com/ansible/ansible.git
Give IncludedFile more context via ansible_search_path (#50045)
* Give IncludedFile more context via ansible_search_path to template lookups. Fixes #49969 * Update unitspull/50563/head
parent
6620facd19
commit
3b49bbcfde
@ -0,0 +1,3 @@
|
||||
bugfixes:
|
||||
- include_tasks - Ensure we give IncludedFile the same context as TaskExecutor when templating the parent include path
|
||||
allowing for lookups in the included file path (https://github.com/ansible/ansible/issues/49969)
|
@ -0,0 +1,11 @@
|
||||
# https://github.com/ansible/ansible/issues/49969
|
||||
- hosts: localhost
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- include_role:
|
||||
name: test
|
||||
public: true
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- included_other is defined
|
@ -0,0 +1 @@
|
||||
- include_tasks: other.yml
|
@ -0,0 +1 @@
|
||||
- include_tasks: "{{ lookup('first_found', inventory_hostname ~ '.yml') }}"
|
@ -0,0 +1,2 @@
|
||||
- set_fact:
|
||||
included_other: true
|
Loading…
Reference in New Issue