Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/lookup_cartesian/tasks/main.yml

raw
1 ---
2 ####################################################################
3 # WARNING: These are designed specifically for Ansible tests #
4 # and should not be used as examples of how to write Ansible roles #
5 ####################################################################
6
7 # Copyright (c) Ansible Project
8 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
9 # SPDX-License-Identifier: GPL-3.0-or-later
10
11 - name: Test cartesian lookup
12 debug: var=item
13 register: product
14 with_community.general.cartesian:
15 - - A
16 - B
17 - C
18 - - '1'
19 - '2'
20 - '3'
21 - name: Verify cartesian lookup
22 assert:
23 that:
24 - product.results[0]['item'] == ["A", "1"]
25 - product.results[1]['item'] == ["A", "2"]
26 - product.results[2]['item'] == ["A", "3"]
27 - product.results[3]['item'] == ["B", "1"]
28 - product.results[4]['item'] == ["B", "2"]
29 - product.results[5]['item'] == ["B", "3"]
30 - product.results[6]['item'] == ["C", "1"]
31 - product.results[7]['item'] == ["C", "2"]
32 - product.results[8]['item'] == ["C", "3"]