community / community.general / 3.8.10 / filter / dict_kv Convert a value to a dictionary with a single key-value pair | "added in version" 1.3.0 of community.general" Authors: Stanislav German-Evtushenko (@giner)community.general.dict_kv (3.8.10) — filter
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Convert a value to a dictionary with a single key-value pair.
- name: Create a one-element dictionary from a value ansible.builtin.debug: msg: "{{ 'myvalue' | dict_kv('mykey') }}"
key: description: The key for the single key-value pair. required: true type: any _input: description: The value for the single key-value pair. required: true type: any
_value: description: A dictionary with a single key-value pair. type: dictionary