summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/include_import
diff options
context:
space:
mode:
authorMatt Martz <matt@sivel.net>2018-04-26 21:25:02 +0200
committerGitHub <noreply@github.com>2018-04-26 21:25:02 +0200
commit4b01b92cfefd2179d7b601a30e60a3fdf45fa35d (patch)
tree3c01a9c43fdc62aa7aad8506ddb11ad398952c56 /test/integration/targets/include_import
parentDon't skip conditional exception on includes (#39377) (diff)
downloadansible-4b01b92cfefd2179d7b601a30e60a3fdf45fa35d.tar.xz
ansible-4b01b92cfefd2179d7b601a30e60a3fdf45fa35d.zip
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
Diffstat (limited to 'test/integration/targets/include_import')
-rw-r--r--test/integration/targets/include_import/include_path_inheritance/one/include_me.yml2
-rw-r--r--test/integration/targets/include_import/include_path_inheritance/playbook.yml14
-rw-r--r--test/integration/targets/include_import/include_path_inheritance/two/include_me.yml2
-rwxr-xr-xtest/integration/targets/include_import/runme.sh4
4 files changed, 22 insertions, 0 deletions
diff --git a/test/integration/targets/include_import/include_path_inheritance/one/include_me.yml b/test/integration/targets/include_import/include_path_inheritance/one/include_me.yml
new file mode 100644
index 0000000000..ea345d2852
--- /dev/null
+++ b/test/integration/targets/include_import/include_path_inheritance/one/include_me.yml
@@ -0,0 +1,2 @@
+- debug:
+ msg: one
diff --git a/test/integration/targets/include_import/include_path_inheritance/playbook.yml b/test/integration/targets/include_import/include_path_inheritance/playbook.yml
new file mode 100644
index 0000000000..b92e0f5d58
--- /dev/null
+++ b/test/integration/targets/include_import/include_path_inheritance/playbook.yml
@@ -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'
diff --git a/test/integration/targets/include_import/include_path_inheritance/two/include_me.yml b/test/integration/targets/include_import/include_path_inheritance/two/include_me.yml
new file mode 100644
index 0000000000..96855323a0
--- /dev/null
+++ b/test/integration/targets/include_import/include_path_inheritance/two/include_me.yml
@@ -0,0 +1,2 @@
+- debug:
+ msg: two
diff --git a/test/integration/targets/include_import/runme.sh b/test/integration/targets/include_import/runme.sh
index ef20bebc6d..4d1990812b 100755
--- a/test/integration/targets/include_import/runme.sh
+++ b/test/integration/targets/include_import/runme.sh
@@ -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 "$@"