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:
2016-12-20 15:04:47 +02:00
parent 2ac931731a
commit 50536af990
6 changed files with 13 additions and 13 deletions

View File

@ -15,7 +15,7 @@ deb http://{{ apt_mirror }}/ubuntu/ {{ ansible_distribution_release }}-updates m
###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu {{ ansible_distribution_release }} partner
{% if ansible_distribution_version == '14.04' %}
{% if ansible_distribution_version | version_compare('14.04', '==') %}
{# extras repo was discontinued after 14.10, but the latest we deploy is 14.04 #}
###### Ubuntu Extras Repo
deb http://extras.ubuntu.com/ubuntu {{ ansible_distribution_release }} main