Add `__init__.py` files to tests directory
The 60 new exclusions are because sanity currently doesn't allow for a docstring in an init: ansible/ansible#77506
Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
Reviewed-by: Sagar Paul <sagpaul@redhat.com>
Consolidate filter plugin
SUMMARY
Consolidate filter plugin
This plugin presents collective structured data including all supplied facts grouping on common attributes mentioned.
ISSUE TYPE
New Module Pull Request
COMPONENT NAME
ansible.utils.consolidate
ADDITIONAL INFORMATION
- hosts: localhost
gather_facts: false
tasks:
- name: Define some test data
ansible.builtin.set_fact:
values:
- name: a
value: 1
- name: b
value: 2
- name: c
value: 3
colors:
- name: a
color: red
- name: b
color: green
- name: c
color: blue
- name: Define some test data
ansible.builtin.set_fact:
base_data:
- data: "{{ values }}"
match_key: name
name: values
- data: "{{ colors }}"
match_key: name
name: colors
- name: Consolidate the data source using the name key
ansible.builtin.set_fact:
consolidated: "{{ data_sources|ansible.utils.consolidate }}"
vars:
sizes:
- name: a
size: small
- name: b
size: medium
- name: c
size: large
additional_data_source:
- data: "{{ sizes }}"
match_key: name
name: sizes
data_sources: "{{ base_data + additional_data_source }}"
# consolidated:
# a:
# colors:
# color: red
# name: a
# sizes:
# name: a
# size: small
# values:
# name: a
# value: 1
# b:
# colors:
# color: green
# name: b
# sizes:
# name: b
# size: medium
# values:
# name: b
# value: 2
# c:
# colors:
# color: blue
# name: c
# sizes:
# name: c
# size: large
# values:
# name: c
# value: 3
- name: Consolidate the data source using different keys
ansible.builtin.set_fact:
consolidated: "{{ data_sources|ansible.utils.consolidate }}"
vars:
sizes:
- title: a
size: small
- title: b
size: medium
- title: c
size: large
additional_data_source:
- data: "{{ sizes }}"
match_key: title
name: sizes
data_sources: "{{ base_data + additional_data_source }}"
# consolidated:
# a:
# colors:
# color: red
# name: a
# sizes:
# size: small
# title: a
# values:
# name: a
# value: 1
# b:
# colors:
# color: green
# name: b
# sizes:
# size: medium
# title: b
# values:
# name: b
# value: 2
# c:
# colors:
# color: blue
# name: c
# sizes:
# size: large
# title: c
# values:
# name: c
# value: 3
- name: Consolidate the data source using the name key (fail_missing_match_key)
ansible.builtin.set_fact:
consolidated: "{{ data_sources|ansible.utils.consolidate(fail_missing_match_key=True) }}"
ignore_errors: true
vars:
vars:
sizes:
- size: small
- size: medium
- size: large
additional_data_source:
- data: "{{ sizes }}"
match_key: name
name: sizes
data_sources: "{{ base_data + additional_data_source }}"
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_missing_match_key'
# reported Missing match key 'name' in data source 2 in list entry 0,
# Missing match key 'name' in data source 2 in list entry 1,
# Missing match key 'name' in data source 2 in list entry 2"
# }
- name: Consolidate the data source using the name key (fail_missing_match_value)
ansible.builtin.set_fact:
consolidated: "{{ data_sources|ansible.utils.consolidate(fail_missing_match_value=True) }}"
ignore_errors: true
vars:
sizes:
- name: a
size: small
- name: b
size: medium
additional_data_source:
- data: "{{ sizes }}"
match_key: name
name: sizes
data_sources: "{{ base_data + additional_data_source }}"
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_missing_match_value'
# reported Missing match value c in data source 2"
# }
- name: Consolidate the data source using the name key (fail_duplicate)
ansible.builtin.set_fact:
consolidated: "{{ data_sources|ansible.utils.consolidate(fail_duplicate=True) }}"
ignore_errors: true
vars:
sizes:
- name: a
size: small
- name: a
size: small
additional_data_source:
- data: "{{ sizes }}"
match_key: name
name: sizes
data_sources: "{{ base_data + additional_data_source }}"
# fatal: [localhost]: FAILED! => {
# "msg": "Error when using plugin 'consolidate': 'fail_duplicate' reported Duplicate values in data source 2"
# }
Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
Reviewed-by: Sagar Paul <sagpaul@redhat.com>
Reviewed-by: Bradley A. Thornton <bthornto@redhat.com>
Sanity tests: copy ignore-2.13.txt to ignore-2.14.txt
SUMMARY
ansible-collections/news-for-maintainers#13
Dear maintainers,
I'd like to ask you to track the news-for-maintainers themselves in the future if possible
Thanks!
Reviewed-by: Ashwini Mhatre <mashu97@gmail.com>
Update black to latest
Upgrade and enable black to latest in .pre-commit-config.yaml
Other changes made by precommit.ci via black upgrade
Reviewed-by: GomathiselviS <None>