Commit Graph

337 Commits (main)

Author SHA1 Message Date
Bradley A. Thornton 854e16a852
Merge branch 'main' into some_init 2022-04-12 14:35:35 -07:00
softwarefactory-project-zuul[bot] 3edb755a0a
Merge pull request #168 from ansible-collections/pre-commit-ci-update-config
[pre-commit.ci] pre-commit autoupdate

updates:

github.com/pre-commit/pre-commit-hooks: v3.1.0 → v4.2.0
github.com/ansible-network/collection_prep: 0.9.4 → 0.9.6

Reviewed-by: Bradley A. Thornton <bthornto@redhat.com>
2022-04-12 14:51:57 +00:00
Bradley A. Thornton b2e61289cf
Merge branch 'main' into some_init 2022-04-12 05:15:05 -07:00
Bradley A. Thornton 3e25320857
Merge branch 'main' into pre-commit-ci-update-config 2022-04-12 04:48:10 -07:00
softwarefactory-project-zuul[bot] e0cce9c2fb
Merge pull request #170 from KB-perByte/prep_260
prep minor release 2.6.0

Reviewed-by: Nilashish Chakraborty <nilashishchakraborty8@gmail.com>
2022-04-12 07:16:22 +00:00
KB-perByte e8817b7b45
release prep 2022-04-12 12:03:54 +05:30
KB-perByte eb305b4af0
prep minor release 2.6.0 2022-04-12 11:59:59 +05:30
pre-commit-ci[bot] 4f1dc39467
[pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/pre-commit/pre-commit-hooks: v3.1.0 → v4.2.0](https://github.com/pre-commit/pre-commit-hooks/compare/v3.1.0...v4.2.0)
- [github.com/ansible-network/collection_prep: 0.9.4 → 0.9.6](https://github.com/ansible-network/collection_prep/compare/0.9.4...0.9.6)
2022-04-11 20:18:23 +00:00
pre-commit-ci[bot] bcbc2bcdaf [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-11 18:43:42 +00:00
cidrblock 363fac094b Fix 2022-04-11 11:43:15 -07:00
cidrblock 4f5497549e Add init 2022-04-11 11:40:39 -07:00
cidrblock 0b67dab6c9 Another init 2022-04-11 07:25:48 -07:00
pre-commit-ci[bot] c9e21bb84b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-11 07:25:48 -07:00
cidrblock 96c7b46584 sanity 2022-04-11 07:25:48 -07:00
cidrblock fd5660ab18 Add init 2022-04-11 07:25:47 -07:00
cidrblock 79c6ad9ae5 Add init 2022-04-11 07:25:47 -07:00
softwarefactory-project-zuul[bot] b9efd5727d
Merge pull request #156 from KB-perByte/consolidate
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>
2022-04-11 12:56:51 +00:00
KB-perByte 6110081f19
sanity fix 2022-04-11 17:20:49 +05:30
pre-commit-ci[bot] 23d80fd8cf [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-11 10:45:49 +00:00
KB-perByte ceb7db1cd3
del extra 2022-04-11 16:15:08 +05:30
KB-perByte ca31a4e474
update docs 2022-04-11 16:13:46 +05:30
KB-perByte 7801c67a5c
update err code 2022-04-11 14:57:00 +05:30
KB-perByte 1ce17fab54
update tests 2022-04-09 11:28:35 +05:30
pre-commit-ci[bot] 4f4db18d41 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-08 18:02:05 +00:00
KB-perByte 595c9ee38f
review pt 1 2022-04-08 23:31:45 +05:30
Sagar Paul 792aa2731c
Merge branch 'ansible-collections:main' into consolidate 2022-04-08 16:31:36 +05:30
softwarefactory-project-zuul[bot] b1d65c5b03
Merge pull request #159 from ansible-collections/copy_ingore_txt
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>
2022-04-08 09:42:54 +00:00
Ashwini Mhatre 90ff4b585c
Merge branch 'main' into copy_ingore_txt 2022-04-08 14:33:20 +05:30
pre-commit-ci[bot] 14282909b4 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-07 21:28:57 +00:00
Bradley A. Thornton d63d684597
Merge branch 'main' into consolidate 2022-04-07 14:28:46 -07:00
softwarefactory-project-zuul[bot] 8ef1d0c688
Merge pull request #163 from cidrblock/enable_precommit
Enable 2 precommit checks

Enable pre-commit.ci end-of-file-fixer
Enable pre-commit.ci trailing-whitespace

Reviewed-by: GomathiselviS <None>
2022-04-07 21:12:11 +00:00
cidrblock e60a03686b Enable 2 precommit checks 2022-04-07 13:24:53 -07:00
Bradley A. Thornton 1c4d7faf83
Merge branch 'main' into consolidate 2022-04-07 13:20:12 -07:00
Bradley A. Thornton 836437c359
Merge branch 'main' into copy_ingore_txt 2022-04-07 13:19:38 -07:00
softwarefactory-project-zuul[bot] c5d2df6256
Merge pull request #158 from cidrblock/Update_black
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>
2022-04-07 19:40:10 +00:00
cidrblock d1d12d4d0d Rebase 2022-04-07 03:30:32 -07:00
cidrblock 29c8072e09 Rebase 2022-04-07 03:29:20 -07:00
pre-commit-ci[bot] c4ad14f305 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-04-07 03:28:27 -07:00
cidrblock b54230531e update black in test-requirements 2022-04-07 03:28:27 -07:00
cidrblock 0c79ad75b0 Add changelog 2022-04-07 03:28:27 -07:00
cidrblock 994792defd No update docs 2022-04-07 03:28:26 -07:00
cidrblock 35c0cdde4c Update black to latest 2022-04-07 03:27:22 -07:00
Bradley A. Thornton 29debd2be6
Add a skips for pre-commit.ci (#161) 2022-04-07 03:06:28 -07:00
Andrew Klychkov ba01915797 Add fragment 2022-04-07 10:49:09 +02:00
Andrew Klychkov 0a1b1de7b2 Sanity tests: copy ignore-2.13.txt to ignore-2.14.txt 2022-04-07 09:12:09 +02:00
KB-perByte 89efc29ab4
update added version 2022-04-06 19:25:56 +05:30
KB-perByte f3e851d544
update review 1 2022-04-06 19:19:48 +05:30
KB-perByte e7d50b8ce6
fix intergration tests 2022-04-06 13:48:47 +05:30
KB-perByte ae4bfa421c
remove strings 2022-04-06 11:20:16 +05:30
KB-perByte 39ab9aeecd
changelog spelling corrected 2022-04-05 15:45:50 +05:30