mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Give IncludedFile more context via ansible_search_path (#50045)
* Give IncludedFile more context via ansible_search_path to template lookups. Fixes #49969 * Update units
This commit is contained in:
@@ -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
|
||||
@@ -90,3 +90,7 @@ ansible-playbook run_once/playbook.yml "$@"
|
||||
# https://github.com/ansible/ansible/issues/48936
|
||||
ansible-playbook -v handler_addressing/playbook.yml 2>&1 | tee test_handler_addressing.out
|
||||
test "$(egrep -c 'include handler task|ERROR! The requested handler '"'"'do_import'"'"' was not found' test_handler_addressing.out)" = 2
|
||||
|
||||
# https://github.com/ansible/ansible/issues/49969
|
||||
ansible-playbook -v parent_templating/playbook.yml 2>&1 | tee test_parent_templating.out
|
||||
test "$(egrep -c 'Templating the path of the parent include_tasks failed.' test_parent_templating.out)" = 0
|
||||
|
||||
Reference in New Issue
Block a user