community.routeros.list_to_dict (2.14.0) — filter

Convert a list of arguments to a dictionary

| "added in version" 2.0.0 of community.routeros"

Authors: Felix Fontein (@felixfontein)

Install collection

Install with ansible-galaxy collection install community.routeros:==2.14.0


Add to requirements.yml

  collections:
    - name: community.routeros
      version: 2.14.0

Description

Convert a list of arguments to a dictionary.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Convert a list to a dictionary
  ansible.builtin.set_fact:
    dictionary: "{{ ['foo=bar', 'comment=foo is bar'] | community.routeros.list_to_dict }}"

Inputs

    
_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

Outputs

_value:
  description: A dictionary representation of the input data.
  type: dictionary