1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins
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
..
action iptables_state: fix race condition between module and its action plugin (#1140) 2020-10-20 20:27:37 +02:00
become Fix various sanity errors in plugins (#881) 2020-09-16 11:06:45 +02:00
cache Fix the linode inventory plugin, and the redis and memcached cache plugins (#1281, #1282, #1283). 2020-11-13 16:01:10 -05:00
callback Remove deprecated modules and plugins. (#1347) 2020-11-23 14:10:18 +01:00
connection Removal of docker content for 2.0.0 (#1304) 2020-11-23 13:03:19 +01:00
doc_fragments Removal of docker content for 2.0.0 (#1304) 2020-11-23 13:03:19 +01:00
filter Add filter dict_kv (#1264) 2020-11-24 05:41:18 +01:00
inventory Removal of docker content for 2.0.0 (#1304) 2020-11-23 13:03:19 +01:00
lookup Fix hashi_vault lookup approle authentication (#1138) 2020-11-16 16:42:42 +01:00
module_utils Removal of docker content for 2.0.0 (#1304) 2020-11-23 13:03:19 +01:00
modules Tidy up validate-modules ignores for monitoring modules (#1350) 2020-11-23 22:07:03 +01:00