Open cfiehe opened 8 months ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @hryamzik @obourdon click here for bot help
!component -plugins/modules/interfaces_file.py
Sounds like a good idea to me! Do you want to work on this, or are you hoping that someone else will do this?
I have created a feature pull request for those filters. I hope, that the code will pass the review 😃.
Files identified in the description: None
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
Summary
The behavioral change in the builtin filters
ansible.builtin.union
,ansible.builtin.intersect
,ansible.builtin.difference
andansible.builtin.symmetric_difference
introduced in Ansible Core 2.16 forces many people including myself to migrate their code in order to stay compatible with the current release: https://github.com/ansible/ansible/issues/82554Starting from Ansible Core 2.16, the builtin filters do no longer preserve the item order, so that the result is unpredictable. This is unwanted in some cases. It is possible to workaround the problem e.g. by replacing
a | union(b)
with(a + b) | unique
, but especially in complex statements where theunion
filter is involved and where ordering is important, you must have an eye on the operator precedencies. The whole code rewriting process is error-prone and statements become ugly and hard to read. In those cases, it would be nice to have replacing filters for theansible.builtin.union
,ansible.builtin.intersect
,ansible.builtin.difference
andansible.builtin.symmetric_difference
which behave in the same way as they did before Ansible Core 2.16.Issue Type
Feature Idea
Component Name
lists_union, lists_intersect, lists_difference, symmetric_difference
Additional Information
Code of Conduct