community.sops._latest_version filter – [INTERNAL] Get latest version from a list of versions
Note
This filter plugin is part of the community.sops collection (version 2.0.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.sops
.
To use it in a playbook, specify: community.sops._latest_version
.
New in community.sops 1.4.0
Synopsis
This is an internal tool and must only be used from roles in this collection! If you use it from outside this collection, be warned that its behavior can change and it can be removed at any time, even in bugfix releases!
Given a list of version numbers, returns the largest of them.
Input
This describes the input of the filter, the value before | community.sops._latest_version
.
Parameter |
Comments |
---|---|
A list of strings. Every string must be a version number. |
Examples
- name: Print latest version
ansible.builtin.debug:
msg: "{{ versions | community.sops._latest_version }}"
vars:
versions:
- 1.0.0
- 1.0.0rc1
- 1.1.0
Return Value
Key |
Description |
---|---|
The latest version from the input. Returns the empty string if the input was empty. Returned: success |