Debian Codegraph @

test/integration/targets/group_by/create_groups.yml

raw
1 # test code for the group_by module
2 # (c) 2014, Chris Church <[email protected]>
3
4 # This file is part of Ansible
5 #
6 # Ansible is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Ansible is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
18
19 - debug: var=genus
20
21 - name: group by genus
22 group_by: key={{ genus }}
23 register: grouped_by_genus
24
25 - debug: var=grouped_by_genus
26
27 - name: ensure we reflect 'changed' on change
28 assert:
29 that:
30 - grouped_by_genus is changed
31
32 - name: group by first three letters of genus with key in quotes
33 group_by: key="{{ genus[:3] }}"
34
35 - name: group by first two letters of genus with key not in quotes
36 group_by: key={{ genus[:2] }}
37
38 - name: group by genus in uppercase using complex args
39 group_by: { key: "{{ genus | upper() }}" }