mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Update TaskInclude _raw_params with the expanded/templated path to file (#39365)
* Update TaskInclude _raw_params with the expanded/templated path to file * Add tests to validate host vars include paths
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
- debug:
|
||||
msg: one
|
||||
@@ -0,0 +1,14 @@
|
||||
- hosts: testhost:testhost2
|
||||
tasks:
|
||||
- set_fact:
|
||||
include_me: one
|
||||
when: inventory_hostname == ansible_play_hosts[0]
|
||||
|
||||
- set_fact:
|
||||
include_me: two
|
||||
when: inventory_hostname == ansible_play_hosts[1]
|
||||
|
||||
- debug:
|
||||
var: include_me
|
||||
|
||||
- include_tasks: '{{ include_me }}/include_me.yml'
|
||||
@@ -0,0 +1,2 @@
|
||||
- debug:
|
||||
msg: two
|
||||
@@ -63,3 +63,7 @@ ANSIBLE_STRATEGY='linear' ansible-playbook test_grandparent_inheritance.yml -i .
|
||||
# undefined_var
|
||||
ANSIBLE_STRATEGY='linear' ansible-playbook undefined_var/playbook.yml -i ../../inventory "$@"
|
||||
ANSIBLE_STRATEGY='free' ansible-playbook undefined_var/playbook.yml -i ../../inventory "$@"
|
||||
|
||||
# Include path inheritance using host var for include file path
|
||||
ANSIBLE_STRATEGY='linear' ansible-playbook include_path_inheritance/playbook.yml -i ../../inventory "$@"
|
||||
ANSIBLE_STRATEGY='free' ansible-playbook include_path_inheritance/playbook.yml -i ../../inventory "$@"
|
||||
|
||||
Reference in New Issue
Block a user