1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

22 commits

Author SHA1 Message Date
Ajpantuso
29e4066944
New filter plugin - unicode_normalization (#3359)
* Initial commit

* Adding maintainer in BOTMETA

* Adding changelog fragment

* Updating filter_guide

* Applying initial review suggestions
2021-09-12 13:46:53 +02:00
Alexei Znamensky
da11a98cb7
fixed the utf-8 marker (#3162) 2021-08-07 15:02:21 +02:00
Alexei Znamensky
047b7ada3c
uf8 marker batch2 (#3128)
* added utf-8 markers to all .py files in plugins/filter

* added utf-8 markers to all .py files in plugins/inventory

* added utf-8 markers to all .py files in plugins/lookup
2021-08-01 12:36:53 +02:00
Felix Fontein
fafabed9e6
Replace ansible.module_utils._text by ansible.module_utils.common.text.converters (#2877)
* Replace ansible.module_utils._text by ansible.module_utils.common.text.converters.

* Also adjust tests.
2021-06-26 23:59:11 +02:00
Felix Fontein
7cd96d963e
meta/runtime.yml and __init__.py cleanup (#2632)
* Remove superfluous __init__.py files.

* Reformat and sort meta/runtime.yml.

* The ovirt modules have been removed.

* Add changelog entry.
2021-05-27 18:49:26 +02:00
Brian Coca
d871399220
json_query, no more 'unknown type' errors (#2607)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2021-05-25 13:04:19 +02:00
Felix Fontein
384655e15c
Add groupby_as_dict filter (#2323)
* Add groupby_as_dict filter.

* Test all error cases.
2021-05-13 21:49:57 +02:00
Ajpantuso
118d903e7d
New filter plugins: hashids_encode and hashids_decode (#2244)
* New filters hashids_encode and hashids_decode

* Adding changelog

* Correcting whitespace issue in vars file

* Attempt to fix integration test failures

* Correcting copyright

* Addressing initial review comments

* Updating decoded sequence return from tuple to list

* Correcting capitilization and spelling
2021-04-17 20:00:03 +02:00
Felix Fontein
b6ae47c455
Add dict filter (#2171)
* Add dict and list_to_dict filters.

* Remove list_to_dict filter.

* Add myself as maintainer.
2021-04-08 07:50:28 +02:00
Felix Fontein
4b6722d938
Add path_join compatibility shim (#2172)
* Add path_join compatibility shim.

* Add myself as maintainer.
2021-04-08 07:49:57 +02:00
Ajpantuso
6529390901
New Filter plugin from_csv (#2037)
* Added from_csv filter and integration tests

* Cleaning up whitespace

* Adding changelog fragment

* Updated changelog fragment name

* Removed temp fragment

* Refactoring csv functions Part 1

* Syncing refactored csv modules/filters

* Adding unit tests for csv Module_Util

* Updating changelog fragment

* Correcting whitespace in unit test

* Improving changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/2037-add-from-csv-filter.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-03-21 13:21:54 +01:00
Eric L
4a8d6cf7cc
Add version_sort filter to properly sort list of versions (#1916)
* Add version_sort filter to properly sort list of versions

* Fix all comments from Felix

- add changelog fragment
- fix test by removing runme.sh/yml and renaming to filter_version_sort
- use fully qualified name of filter in test case

* Remove wrong plugin.test changelog fragment

Ups...

* Properly name the file version_sort.py

* Update changelogs/fragments/1916-add-version-sort-filter.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Eric L <ewl+git@lavar.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-27 17:42:45 +01:00
Vladimir Botka
0f88c71f59
Added filter plugin lists_mergeby. Fix #249 (#604) 2020-12-04 09:32:42 -05:00
Abhijeet Kasurde
5319437bc2
json_query: Handle AnsibleUnicode, AnsibleUnsafeText (#1434)
jmespath library does not undestand custom string types
such as AnsibleUnicode, and AnsibleUnsafeText.
So user need to use ``to_json | from_json`` filter while using
functions like ``starts_with`` and ``contains`` etc.
This hack will allow user to get rid of this filter.

Fixes: #320

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-12-04 07:24:42 +01:00
Stanislav German-Evtushenko
44fd157a2b
Add filter dict_kv (#1264)
- Add filter `dict_kv` which returns a single key-value pair dictionary created from two arguments

Example 1

```
- hosts: localhost
  gather_facts: false
  vars:
    myvar: myvalue
  tasks:
  - debug:
      msg: "{{ myvar | dict_kv('thatsmyvar') }}"

OUTPUT:
ok: [localhost] => {
    "msg": {
        "thatsmyvar": "myvalue"
    }
}
```

Example 2

```
- hosts: localhost
  gather_facts: false
  vars:
    common_config:
      type: host
      database: all
    myservers:
    - server1
    - server2
  tasks:
  - debug:
      msg: "{{ myservers | map('dict_kv', 'server') | map('combine', common_config) }}"

OUTPUT:
ok: [localhost] => {
    "msg": [
        {
            "database": "all",
            "server": "server1",
            "type": "host"
        },
        {
            "database": "all",
            "server": "server2",
            "type": "host"
        }
    ]
}
```
2020-11-24 05:41:18 +01:00
Kelly Brazil
b2a222b136
JC plugin (#750)
* initial commit

* add contrib info

* remove nonfunctional \n in error messate

* add documentation and optional quiet and raw arguments

* add changelog fragment

* add aliases

* add initial test

* change folder name

* add pip install jc for tests

* simplify changelog since tests were failing

* add newline to end of file

* fix trailing whitespace in comment causing test failure

* use pip3 since tests are failing using python2.6 pip

* skip python 2.7 tests since jc only supports python 3

* use pip instead of pip3

* add python version requirement
2020-08-11 09:12:17 +03:00
Andrew Klychkov
c055340ecb
modules: fix examples to use FQCN for builtin modules (#648)
* modules: fix examples to use FQCN for builtin modules

* fix

* fix

* fix

* fix

* fix

* fix

* fix
2020-07-14 18:28:08 +03:00
René Moser
7b2ad8a80c
time_filter: improve hints in error message (#368) 2020-05-20 09:22:56 +02:00
Felix Fontein
0399127d11
Time filter improvements (#359)
* Adjust target directory so that ansible-test knows what to run when filters change.

* Divide by multiple instead of multiplying with product of 1/factor to improve numerical robustness.

* Allow to say what a year or month is (in days).

* Add changelog fragment announcing the time filters.

* Make sure unknown keyword args result in errors.

* Fix formatting screw-up.
2020-05-19 11:18:49 +02:00
René Moser
945296f314
filter: add new time convert filter (#347)
* filter: add new time convert filters

The plugin include:
- to_seconds
- to_minutes
- to_hours

* refactor and extend

* more UX improvements

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* even more UX improvments

* fix indentation

* fix for py3

* enable aix in ci

* simplify

* add to_months, use 360d as year.

* rearrange tests

* year back to 365 days

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-05-18 09:54:23 +02:00
Abhijeet Kasurde
eb485c5f6f
Move gcp_kms_filters to google.cloud collection (#140)
gcp_kms_filters is a part of google.cloud collection

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-04-10 19:22:39 +01:00
Ansible Core Team
aebc1b03fd Initial commit 2020-03-09 09:11:07 +00:00