community / community.general / 3.8.10 / filter / version_sort Sort a list according to version order instead of pure alphabetical one | "added in version" 2.2.0 of community.general" Authors: Eric L. (@ericzolf)community.general.version_sort (3.8.10) — filter
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Sort a list according to version order instead of pure alphabetical one.
- name: Convert list of tuples into dictionary ansible.builtin.set_fact: dictionary: "{{ ['2.1', '2.10', '2.9'] | community.general.version_sort }}"
_input: description: A list of strings to sort. elements: string required: true type: list
_value: description: The list of strings sorted by version. elements: string type: list