community / community.routeros / 2.14.0 / filter / list_to_dict Convert a list of arguments to a dictionary | "added in version" 2.0.0 of community.routeros" Authors: Felix Fontein (@felixfontein)community.routeros.list_to_dict (2.14.0) — filter
Install with ansible-galaxy collection install community.routeros:==2.14.0
collections: - name: community.routeros version: 2.14.0
Convert a list of arguments to a dictionary.
- name: Convert a list to a dictionary ansible.builtin.set_fact: dictionary: "{{ ['foo=bar', 'comment=foo is bar'] | community.routeros.list_to_dict }}"
_input: description: - A list of assignments. Can be the result of the P(community.routeros.split#filter) filter. elements: string required: true type: list skip_empty_values: default: false description: - Allows to skip arguments whose value is empty when set to V(true). type: boolean require_assignment: default: true description: - Allows to accept arguments without values when set to V(false). type: boolean
_value: description: A dictionary representation of the input data. type: dictionary