summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/lookup_first_found
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2023-05-08 20:25:25 +0200
committerGitHub <noreply@github.com>2023-05-08 20:25:25 +0200
commit5a84ff26df8e32cde312c95963071eb375a7cd27 (patch)
treeb0993c3e913a0185d3fdca3116ee930a3187c46f /test/integration/targets/lookup_first_found
parentdocsite build: upgrade sphinx-ansible-theme and antsibull-core (#80734) (diff)
downloadansible-5a84ff26df8e32cde312c95963071eb375a7cd27.tar.xz
ansible-5a84ff26df8e32cde312c95963071eb375a7cd27.zip
first_found fix no terms option (#76550)
also fix bug with multiple items clobbering previous settings Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
Diffstat (limited to 'test/integration/targets/lookup_first_found')
-rw-r--r--test/integration/targets/lookup_first_found/tasks/main.yml8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/integration/targets/lookup_first_found/tasks/main.yml b/test/integration/targets/lookup_first_found/tasks/main.yml
index 9aeaf1d1ed..d0ca91eaf5 100644
--- a/test/integration/targets/lookup_first_found/tasks/main.yml
+++ b/test/integration/targets/lookup_first_found/tasks/main.yml
@@ -94,3 +94,11 @@
- assert:
that:
- foo is defined
+
+# TODO: no 'terms' test
+- name: test first_found lookup with no terms
+ set_fact:
+ no_terms: "{{ query('first_found', files=['missing1', 'hosts', 'missing2'], paths=['/etc'], errors='ignore') }}"
+
+- assert:
+ that: "no_terms|first == '/etc/hosts'"