From: Thanh Ha Date: Tue, 20 Aug 2019 02:19:54 +0000 (-0400) Subject: Fix conditionals so role works with newer Ubuntu X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F16606%2F2;p=ansible%2Froles%2Fpython-install.git Fix conditionals so role works with newer Ubuntu 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 Change-Id: I0a943d797658c11f5f04fb2530369c05031b9e25 --- diff --git a/tasks/main.yml b/tasks/main.yml index cda0ac7..734a9fa 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 }}'