From 708614a0b10573295b9d6403eaa80310fbbcd8f4 Mon Sep 17 00:00:00 2001 From: Eric Ball Date: Tue, 20 Aug 2024 17:47:04 -0700 Subject: [PATCH] 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 --- tasks/main.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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' -- 2.16.6