I would like to ensure Java is installed and the oldest acceptable version is 11. How can I achieve that in ansible?
I have tried
- name: Fetch Java version
shell: java -version 2>&1 | grep version | awk '{print $3}' | sed 's/"//g'
register: java_version
- assert:
that:
- java_version.stdout | version_compare('11', '>=')
Which does not work anymore because of the discontinued syntax in the assert
.