mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Adds user-selectable hash merging support in vars
Hash variables are currently overriden if they are redefined. This
doesn't let the user refine hash entries or overriding selected keys,
which can, for some, be a desirable feature.
This patch let the user force hash merging by setting the
hash_behaviour value to "merge" (without the quotes) in ansible.cfg
However, by default, ansible behaves like it always did and if any value
besides "merge" is used ("replace" is suggested in the example ansible.cfg
file), it will also behave as always.
This commit is contained in:
@@ -76,6 +76,16 @@ remote_port=22
|
||||
|
||||
sudo_exe=sudo
|
||||
|
||||
# how to handle hash defined in several places
|
||||
# hash can be merged, or replaced
|
||||
# if you use replace, and have multiple hashes named 'x', the last defined
|
||||
# will override the previously defined one
|
||||
# if you use merge here, hash will cumulate their keys, but keys will still
|
||||
# override each other
|
||||
# replace is the default value, and is how ansible always handled hash variables
|
||||
#
|
||||
# hash_behaviour=replace
|
||||
|
||||
# if set, always use this private key file for authentication, same as if passing
|
||||
# --private-key to ansible or ansible-playbook
|
||||
|
||||
|
||||
Reference in New Issue
Block a user