It is unclear why Ubuntu was set to use "system <version>" 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 "<version>", 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 <eball@linuxfoundation.org>
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'