Skip to content

Commit

Permalink
Add tests to validate host vars include paths
Browse files Browse the repository at this point in the history
  • Loading branch information
sivel committed Apr 26, 2018
1 parent 0698594 commit 5dfbc85
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
@@ -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
4 changes: 4 additions & 0 deletions test/integration/targets/include_import/runme.sh
Expand Up @@ -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 "$@"

0 comments on commit 5dfbc85

Please sign in to comment.