I want to get the highest value of a child key with Ansible and store it in a variable. I’m able to do it with a bash command, which I could easily use with Ansible but I’m sure there is a more Ansible way to do it. Here is what I currently have:
- name: get latest version
hosts: localhost
gather_facts: no
tasks:
- name: get latest version
ansible.builtin.command: curl --silent https://download.checkmk.com/stable_downloads.json | jq -r '.checkmk[].version' | sort -r | head -1
How could I improve this and store it in a variable? Thank you!