From: Eric Ball Date: Wed, 21 Aug 2024 00:47:04 +0000 (-0700) Subject: Fix: Make "pyenv global" command work for all OSs X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=708614a0b10573295b9d6403eaa80310fbbcd8f4;p=ansible%2Froles%2Fpython-install.git Fix: Make "pyenv global" command work for all OSs It is unclear why Ubuntu was set to use "system " for the global python version. While this command does not cause an error, it effectively sets the global version to the system version, which is not what it's supposed to accomplish. In order to set the version to "", we need to remove "system" from the command. This makes the command for CentOS and Ubuntu identical, so decision code has also been removed. Change-Id: I00a7c6e22c4c7be3ec230b755aa3372479d802ac Signed-off-by: Eric Ball --- diff --git a/tasks/main.yml b/tasks/main.yml index ca7b6cf..8e257a0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -81,9 +81,5 @@ when: - (ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '18.04') or (ansible_distribution == 'CentOS' and ansible_distribution_major_version >= '8') - - name: 'Set the required python 3.x versions using pyenv on Ubuntu' # noqa no-changed-when - ansible.builtin.command: 'pyenv global system {{ pyenv_cmd }}' - when: ansible_distribution == 'Ubuntu' - - name: 'Set the required python 3.x versions using pyenv on CentOS' # noqa no-changed-when + - name: 'Set the required python 3.x versions using pyenv' # noqa no-changed-when ansible.builtin.command: 'pyenv global {{ pyenv_cmd }}' - when: ansible_distribution == 'CentOS'