Use Ansible's version_compare instead of doing math on strings
I'm surprised this worked all these years actually. Since Ansible version 1.6 it has been possible to use the version_compare filter instead of doing math logic on strings. See: https://docs.ansible.com/ansible/playbooks_tests.html
This commit is contained in:
@ -22,7 +22,7 @@
|
||||
# dependencies certbot checks for on its first run
|
||||
# taken from running certbot right after a clean Ubuntu 16.04 install
|
||||
- name: Install certbot dependencies (Ubuntu 16.04)
|
||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '16.04'
|
||||
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version | version_compare('16.04', '==')
|
||||
apt: name={{ item }} state=present update_cache=yes
|
||||
with_items:
|
||||
- augeas-doc
|
||||
|
Reference in New Issue
Block a user