1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00
community.general/tests/integration/targets/lookup_merge_variables
patchback[bot] e7e9cf97e5
[PR #11536/dae2157b backport][stable-12] merge_variables: extended merge capabilities added (#11626)
merge_variables: extended merge capabilities added (#11536)

* merge_variables: extended merge capabilities added

This extension gives you more control over the variable merging process of the lookup plugin `merge_variables`. It closes the gap between Puppet's Hiera merging capabilities and the limitations of Ansible's default variable plugin `host_group_vars` regarding fragment-based value definition. You can now decide which merge strategy should be applied to dicts, lists, and other types. Furthermore, you can specify a merge strategy that should be applied in case of type conflicts.

The default behavior of the plugin has been preserved so that it is fully backward-compatible with the already implemented state.



* Update changelogs/fragments/11536-merge-variables-extended-merging-capabilities.yml



* Update plugins/lookup/merge_variables.py



* Periods added at the end of each choice description



* Update plugins/lookup/merge_variables.py



* ref: follow project standard for choice descriptions



* ref: more examples added and refactoring



* Update plugins/lookup/merge_variables.py



* ref: some more comments to examples added



* fix: unused import removed



* ref: re-add "merge" to strategy map



* Update comments



* Specification of transformations solely as string



* Comments updated



* ref: `append_rp` and `prepend_rp` removed
feat: options dict for list transformations re-added
feat: allow setting `keep` for dedup transformation with possible values: `first` (default) and `last`



* ref: improve options documentation



* ref: documentation improved, avoiding words like newer or older in merge description



* Update plugins/lookup/merge_variables.py



* ref: "prio" replaced by "dict"



* feat: two integration tests added



---------





(cherry picked from commit dae2157bb7)

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <cfiehe@users.noreply.github.com>
Co-authored-by: Fiehe Christoph <c.fiehe@eurodata.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Mark <40321020+m-a-r-k-e@users.noreply.github.com>
2026-03-19 22:59:56 +01:00
..
aliases CI: remove skip/python2.6 from aliases (#7534) 2023-11-16 21:02:40 +01:00
runme.sh bug(lookup/merge_variables): Fix rendering foreign variables (#8303) 2024-05-11 16:51:51 +02:00
test.yml [PR #11536/dae2157b backport][stable-12] merge_variables: extended merge capabilities added (#11626) 2026-03-19 22:59:56 +01:00
test_all_hosts.yml feat(lookup/merge_variables): Add all hosts mode to collect configuration across multiple hosts (#7999) 2024-03-08 07:25:39 +01:00
test_cross_host_merge_inventory.yml bug(lookup/merge_variables): Fix rendering foreign variables (#8303) 2024-05-11 16:51:51 +02:00
test_cross_host_merge_play.yml bug(lookup/merge_variables): Fix rendering foreign variables (#8303) 2024-05-11 16:51:51 +02:00
test_inventory_all_hosts.yml feat(lookup/merge_variables): Add all hosts mode to collect configuration across multiple hosts (#7999) 2024-03-08 07:25:39 +01:00
test_with_env.yml Add new merge_variables lookup plugin (#5533) 2023-03-26 11:27:30 +02:00
vars.yml [PR #11536/dae2157b backport][stable-12] merge_variables: extended merge capabilities added (#11626) 2026-03-19 22:59:56 +01:00