ansible / ansible.builtin / v2.16.0 / filter / items2dict Consolidate a list of itemized dictionaries into a dictionary | "added in version" 2.7 of ansible.builtin" Authors: Ansible core teamansible.builtin.items2dict (v2.16.0) — filter
pip
Install with pip install ansible-core==2.16.0
Takes a list of dicts with each having a C(key) and C(value) keys, and transforms the list into a dictionary, effectively as the reverse of R(dict2items,ansible_collections.ansible.builtin.dict2items_filter).
_input: description: - A list of dictionaries. - Every dictionary must have keys C(key) and C(value). elements: dict required: true type: list key_name: default: key description: The name of the key in the element dictionaries that holds the key to use at destination. type: str value_name: default: value description: The name of the key in the element dictionaries that holds the value to use at destination. type: str
_value: description: Dictionary with the consolidated key/values. type: dict