Use version_compare to test for Ubuntu 18.04 "bionic"

It just feels more correct, plus I usually forget the release code
name from time to time.
This commit is contained in:
Alan Orth 2018-03-21 20:31:55 +02:00
parent ed607aab68
commit d1ba60e15d
3 changed files with 4 additions and 4 deletions

View File

@ -1,4 +1,4 @@
{% if ansible_distribution_release == 'bionic' %} {% if ansible_distribution_version | version_compare('18.04', '==') %}
# 2018-03-17: no Ubuntu 18.04 "bionic" packages yet, so use 17.10 "artful" # 2018-03-17: no Ubuntu 18.04 "bionic" packages yet, so use 17.10 "artful"
deb https://pkg.tarsnap.com/deb/artful ./ deb https://pkg.tarsnap.com/deb/artful ./
{% else %} {% else %}

View File

@ -1,7 +1,7 @@
# {{ ansible_managed }} # {{ ansible_managed }}
{% if ansible_distribution == 'Ubuntu' %} {% if ansible_distribution == 'Ubuntu' %}
{% if ansible_distribution_release == 'bionic' %} {% if ansible_distribution_version | version_compare('18.04', '==') %}
# 2018-03-17: no Ubuntu 18.04 "bionic" packages yet, so use 17.10 "artful" # 2018-03-17: no Ubuntu 18.04 "bionic" packages yet, so use 17.10 "artful"
deb [arch=amd64,i386] http://mariadb.mirror.serveriai.lt/repo/10.2/ubuntu artful main deb [arch=amd64,i386] http://mariadb.mirror.serveriai.lt/repo/10.2/ubuntu artful main
{% else %} {% else %}

View File

@ -2,14 +2,14 @@
{% if ansible_distribution == 'Ubuntu' %} {% if ansible_distribution == 'Ubuntu' %}
{% if nginx_version == "stable" %} {% if nginx_version == "stable" %}
{% if ansible_distribution_release == 'bionic' %} {% if ansible_distribution_version | version_compare('18.04', '==') %}
# 2018-03-17: no Ubuntu 18.04 "bionic" packages yet, so use 17.10 "artful" # 2018-03-17: no Ubuntu 18.04 "bionic" packages yet, so use 17.10 "artful"
deb https://nginx.org/packages/ubuntu/ artful nginx deb https://nginx.org/packages/ubuntu/ artful nginx
{% else %} {% else %}
deb https://nginx.org/packages/ubuntu/ {{ ansible_distribution_release }} nginx deb https://nginx.org/packages/ubuntu/ {{ ansible_distribution_release }} nginx
{% endif %} {% endif %}
{% elif nginx_version == "mainline" %} {% elif nginx_version == "mainline" %}
{% if ansible_distribution_release == 'bionic' %} {% if ansible_distribution_version | version_compare('18.04', '==') %}
# 2018-03-17: no Ubuntu 18.04 "bionic" packages yet, so use 17.10 "artful" # 2018-03-17: no Ubuntu 18.04 "bionic" packages yet, so use 17.10 "artful"
deb https://nginx.org/packages/mainline/ubuntu/ artful nginx deb https://nginx.org/packages/mainline/ubuntu/ artful nginx
{% else %} {% else %}