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

@ -63,7 +63,7 @@ server {
# See: https://httpoxy.org/
fastcgi_param HTTP_PROXY "";
{% if ansible_distribution_version == '16.04' %}
{% if ansible_distribution_version | version_compare('16.04', '==') %}
fastcgi_pass unix:/run/php/php7.0-fpm-{{ domain_name }}.sock;
{% else %}
fastcgi_pass unix:/var/run/php5-fpm-{{ domain_name }}.sock;