diff options
Diffstat (limited to 'test/integration/targets/lookups')
-rw-r--r-- | test/integration/targets/lookups/tasks/main.yml | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/test/integration/targets/lookups/tasks/main.yml b/test/integration/targets/lookups/tasks/main.yml index ba2a024637..7700758164 100644 --- a/test/integration/targets/lookups/tasks/main.yml +++ b/test/integration/targets/lookups/tasks/main.yml @@ -188,23 +188,24 @@ - name: set variable that clashes set_fact: - LOGNAME: foobar + PATH: foobar -- name: get LOGNAME environment var value - shell: echo {{ '$LOGNAME' }} - register: known_var_value +- name: get PATH environment var value + set_fact: + known_var_value: "{{ lookup('pipe', 'echo $PATH') }}" -- name: do the lookup for env LOGNAME +- name: do the lookup for env PATH set_fact: - test_val: "{{ lookup('env', 'LOGNAME') }}" + test_val: "{{ lookup('env', 'PATH') }}" - debug: var=test_val - name: compare values assert: that: - - "test_val == known_var_value.stdout" + - "test_val != ''" + - "test_val == known_var_value" - name: set with_dict @@ -243,7 +244,7 @@ - "'{{ badssl_host_substring }}' in web_data" - name: Test cartesian lookup - debug: var={{item}} + debug: var=item with_cartesian: - ["A", "B", "C"] - ["1", "2", "3"] @@ -296,9 +297,9 @@ - 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_user") }}' + var_host_info: '{{ query("vars", "ansible_host", "ansible_connection") }}' - assert: that: - 'var_host_info[0] == ansible_host' - - 'var_host_info[1] == ansible_user' + - 'var_host_info[1] == ansible_connection' |