[DEPRECATION WARNING]: DEFAULT_HASH_BEHAVIOUR, proposed alternative not applicable #72669
Labels
affects_2.10
This issue/PR affects Ansible v2.10
bug
This issue/PR relates to a bug.
python3
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
SUMMARY
The
DEFAULT_HASH_BEHAVIOUR
configuration option will be deprecated in version 2.13. The Proposed alternative to use thecombine
filter is not a suitable replacement, as a lot of flexibility and severely limiting the feature set of the ansible inventory.ISSUE TYPE
COMPONENT NAME
DEFAULT_HASH_BEHAVIOUR deprecation warning
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
A usecase for
DEFAULT_HASH_BEHAVIOUR=merge
is the merging of firewall rules defined in different groups and hostfile to a single hash of rules, that can then be templated:after merging of the two (or more) hashes the resulting
iptables
hash is fed to the following template:this produces file, that can be read by
iptables-restore
This is but one application of such hash merging behaviour. Others are possible.
While it might be possible to construct a role/template/inventory structure using the
combine
filter to replicate this behaviour, I believe it will be less elegant and adaptable.Furthermore the
combine
filter is not a catch-all solution for this dilemma and requires separate refactoring of all application.EXPECTED RESULTS
Continue to provide the posibility to merge variables on an inventory level.
Alternatively please provide a solution, that can be applied more broadly without the need to refactor all affected roles.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: