1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/docs/docsite/helper/lists_mergeby/examples.yml

55 lines
1.7 KiB
YAML
Raw Normal View History

Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
examples:
- label: 'In the example below the lists are merged by the attribute ``name``:'
file: example-001_vars/list3.yml
lang: 'yaml+jinja'
- label: 'This produces:'
file: example-001.out
lang: 'yaml'
- label: 'It is possible to use a list of lists as an input of the filter:'
file: example-002_vars/list3.yml
lang: 'yaml+jinja'
- label: 'This produces the same result as in the previous example:'
file: example-002.out
lang: 'yaml'
Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
- label: 'Example ``list_merge=replace`` (default):'
file: example-003_vars/list3.yml
Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
lang: 'yaml+jinja'
- label: 'This produces:'
file: example-003.out
lang: 'yaml'
- label: 'Example ``list_merge=keep``:'
file: example-004_vars/list3.yml
Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
lang: 'yaml+jinja'
- label: 'This produces:'
file: example-004.out
lang: 'yaml'
- label: 'Example ``list_merge=append``:'
file: example-005_vars/list3.yml
Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
lang: 'yaml+jinja'
- label: 'This produces:'
file: example-005.out
lang: 'yaml'
- label: 'Example ``list_merge=prepend``:'
file: example-006_vars/list3.yml
Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
lang: 'yaml+jinja'
- label: 'This produces:'
file: example-006.out
lang: 'yaml'
- label: 'Example ``list_merge=append_rp``:'
file: example-007_vars/list3.yml
Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
lang: 'yaml+jinja'
- label: 'This produces:'
file: example-007.out
lang: 'yaml'
- label: 'Example ``list_merge=prepend_rp``:'
file: example-008_vars/list3.yml
Add options to filter lists_mergeby (#4058) * Update filter lists_mergeby #4057 * Added options 'recursive' and 'list_merge'. The functionality of the added options is the same as in the filter 'combine'. * Allow the user to do [list1, list2, ...]|lists_mergeby('index') * Use the function merge_hash from ansible.utils.vars * Add merge_hash_wrapper to test Ansible version * Enable Ansible 2.9 and lower versions with default options of lists_mergeby only. * Non-default options of lists_mergeby trigger error in 2.9 and lower versions. * Update messages and tests. * Fix tests. * Use LooseVersion instead of SpecifierSet. * Update docs 'Filter Guide' section 'Merging lists of dictionaries'. * Added changelog fragment. * Update changelogs/fragments/4058-lists_mergeby-add-parameters.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Added examples; moved to rst/examples; fixes. * Improve error message testing sequence. * Removed .yamllint * Update docs/docsite/rst/examples/lists_mergeby/example-003.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-004.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-005.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-006.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-007.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/filter_list/tasks/lists_mergeby_default.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/example-008.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Fix docs. Antsibull only copies .rst files. * Fix examples in-line. * Update docs/docsite/rst/filter_guide.rst Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs/docsite/rst/examples/lists_mergeby/examples.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update docs lists_mergeby. Remove rubbish. * Emphasized labes of examples in filter_guide.rst * Removed temporary file examples/lists_mergeby/examples.rst * Removed tests/integration/targets/filter_list/runme.* * Fix docs. Description of the lists_merge options. * Move helper files out of rst/ directory. Co-authored-by: Felix Fontein <felix@fontein.de>
2022-01-28 08:19:19 +01:00
lang: 'yaml+jinja'
- label: 'This produces:'
file: example-008.out
lang: 'yaml'