fix: Add version check for pyenv_cmd usage
The pyenv_cmd variable is only set for Ubuntu >= 22.04 and CentOS >= 9,
but was being used unconditionally in 'pyenv global' commands. This
caused failures on Ubuntu 20.04 and older CentOS versions.
Fixed by adding proper version checks using ansible_facts to:
- Only run 'pyenv global' on Ubuntu >= 22.04
- Only run 'pyenv global' on CentOS >= 9
- Avoid deprecation warnings by using ansible_facts instead of
ansible_distribution variables
This resolves the error:
'pyenv_cmd' is undefined
Change-Id: I768f327edc02c04365f8be60f94d32fe21eed47d
Signed-off-by: Anil Belur <askb23@gmail.com>
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>