Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/lookup_etcd3/tasks/tests.yml

raw
1 ---
2 # lookup_etcd3 integration tests
3 # Copyright 2020, SCC France, Eric Belhomme <[email protected]>
4 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
5 # SPDX-License-Identifier: GPL-3.0-or-later
6
7 - block:
8 - name: 'Fetch secrets using "etcd3" lookup'
9 set_fact:
10 etcdoutkey1: "{{ lookup('community.general.etcd3', etcd3_prefix, prefix=True) }}"
11 etcdoutkey2: "{{ lookup('community.general.etcd3', etcd3_singlekey) }}"
12 key_inexistent: "{{ lookup('community.general.etcd3', 'inexistent_key') }}"
13
14 - name: 'Check etcd values'
15 assert:
16 msg: 'unexpected etcd3 values'
17 that:
18 - etcdoutkey1 is sequence
19 - etcdoutkey1 | length() == 3
20 - etcdoutkey1[0].value == 'bar1'
21 - etcdoutkey1[1].value == 'bar2'
22 - etcdoutkey1[2].value == 'bar3'
23 - etcdoutkey2 is sequence
24 - etcdoutkey2 | length() == 2
25 - etcdoutkey2.value == 'foobar'
26 - key_inexistent is sequence
27 - key_inexistent | length() == 0