Fix conditionals so role works with newer Ubuntu 06/16606/2
authorThanh Ha <zxiiro@gmail.com>
Tue, 20 Aug 2019 02:19:54 +0000 (22:19 -0400)
committerThanh Ha <zxiiro@gmail.com>
Tue, 20 Aug 2019 02:33:18 +0000 (22:33 -0400)
Fix conditionals so that the role works with Ubuntu versions
newer than 18.04 too considering the conditionals isn't specific
to 18.04 but rather 18.04 and newer.

Signed-off-by: Thanh Ha <zxiiro@gmail.com>
Change-Id: I0a943d797658c11f5f04fb2530369c05031b9e25

tasks/main.yml

index cda0ac7..734a9fa 100644 (file)
@@ -13,7 +13,7 @@
 - name: Check pyenv global command
   set_fact:
     pyenv_command: 'pyenv global system {{ python37_version }} {{ python36_version }} {{ python35_version }}'
-  when: ansible_distribution_version == '18.04'
+  when: ansible_distribution_version >= '18.04'
 
 - name: Install Python via pyenv
   environment:
@@ -31,7 +31,7 @@
         version: '{{ pyenv_version }}'
     - name: 'Install Python {{ python34_version }}'
       command: pyenv install -s "$PYTHON34_VERSION"
-      when: ansible_distribution_version != '18.04'
+      when: ansible_distribution_version < '18.04'
     - name: 'Install Python {{ python35_version }}'
       command: pyenv install -s "$PYTHON35_VERSION"
     - name: 'Install Python {{ python36_version }}'