summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/lookup_vars/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'test/integration/targets/lookup_vars/tasks/main.yml')
-rw-r--r--test/integration/targets/lookup_vars/tasks/main.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/integration/targets/lookup_vars/tasks/main.yml b/test/integration/targets/lookup_vars/tasks/main.yml
new file mode 100644
index 0000000000..f24d8657ad
--- /dev/null
+++ b/test/integration/targets/lookup_vars/tasks/main.yml
@@ -0,0 +1,16 @@
+- name: Test that we can give it a single value and receive a single value
+ set_fact:
+ var_host: '{{ lookup("vars", "ansible_host") }}'
+
+- assert:
+ that:
+ - 'var_host == ansible_host'
+
+- name: Test that we can give a list of values to var and receive a list of values back
+ set_fact:
+ var_host_info: '{{ query("vars", "ansible_host", "ansible_connection") }}'
+
+- assert:
+ that:
+ - 'var_host_info[0] == ansible_host'
+ - 'var_host_info[1] == ansible_connection'