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

8 commits

Author SHA1 Message Date
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