summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/lookup_first_found
diff options
context:
space:
mode:
authorBrian Coca <bcoca@users.noreply.github.com>2021-04-13 21:52:42 +0200
committerGitHub <noreply@github.com>2021-04-13 21:52:42 +0200
commit84e473a26ea95afec207409c42ba872c009fe6b6 (patch)
treeb64d3bbf9384c3134c97a06c658ec7062cefada2 /test/integration/targets/lookup_first_found
parentBump azure-pipelines-test-container to version 1.9.0 (diff)
downloadansible-84e473a26ea95afec207409c42ba872c009fe6b6.tar.xz
ansible-84e473a26ea95afec207409c42ba872c009fe6b6.zip
All lookups ported to config system (#74108)
* all lookups to support config system - added get_options to get full dict with all opts - fixed tests to match new error messages - kept inline string k=v parsing methods for backwards compat - placeholder depredation for inline string k=v parsing - updated tests and examples to also show new way - refactored and added comments to most custom k=v parsing - added missing docs for template_vars to template - normalized error messages and exception types - fixed constants default - better details value errors Co-authored-by: Felix Fontein <felix@fontein.de>
Diffstat (limited to 'test/integration/targets/lookup_first_found')
-rw-r--r--test/integration/targets/lookup_first_found/tasks/main.yml21
1 files changed, 17 insertions, 4 deletions
diff --git a/test/integration/targets/lookup_first_found/tasks/main.yml b/test/integration/targets/lookup_first_found/tasks/main.yml
index 87f2a4045c..e85f4f27ad 100644
--- a/test/integration/targets/lookup_first_found/tasks/main.yml
+++ b/test/integration/targets/lookup_first_found/tasks/main.yml
@@ -1,10 +1,9 @@
- name: test with_first_found
- #shell: echo {{ item }}
set_fact: "first_found={{ item }}"
with_first_found:
- - "{{ role_path + '/files/does_not_exist' }}"
- - "{{ role_path + '/files/foo1' }}"
- - "{{ role_path + '/files/bar1' }}"
+ - "does_not_exist"
+ - "foo1"
+ - "{{ role_path + '/files/bar1' }}" # will only hit this if dwim search is broken
- name: set expected
set_fact: first_expected="{{ role_path + '/files/foo1' }}"
@@ -24,6 +23,7 @@
vars:
params:
files: "not_a_file.yaml"
+ skip: True
- name: verify q(first_found) result
assert:
@@ -71,3 +71,16 @@
assert:
that:
- "this_not_set is not defined"
+
+- name: test legacy formats
+ set_fact: hatethisformat={{item}}
+ vars:
+ params:
+ files: not/a/file.yaml;hosts
+ paths: not/a/path:/etc
+ loop: "{{ q('first_found', params) }}"
+
+- name: verify /etc/hosts was found
+ assert:
+ that:
+ - "hatethisformat == '/etc/hosts'"