Yak core: role artificats - AWS_S3 - check python version installed

Hi Yak core team,

While trying to rollout a component on SLES12 and/or 15 we fall accross python issues related to the Artifacts role for AWS Python SDK.

Indeed, boto3 requires specific python versions:

SLES12 error

TASK [yak.core.artifacts : Install boto3] ************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ModuleNotFoundError: No module named 'pkg_resources'
fatal: [aws_dbi_test/srv-sles12-ora]: FAILED! => {"changed": false, "msg": "Failed to import the required Python library (setuptools) on srv-sles12-ora's Python /usr/bin/python3.6. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter"}

SLES15 error

TASK [yak.core.artifacts : Install boto3] ************************************************************************************************
fatal: [aws_dbi_test/srv-sles15-ora]: FAILED! => {"changed": false, "cmd": ["/usr/bin/python3.6", "-m", "pip.__main__", "install", "boto3"], "msg": "stdout: Requirement already satisfied: boto3 in /usr/lib/python3.6/site-packages (1.26.89)\n\n:stderr: ERROR: Package 'boto3' requires a different Python: 3.6.15 not in '>= 3.7'\n"}

Might be worse to add a small dependency check to ensure the python version is "compatible"

Hereby the AMIs used for our tests:

  • SLES12 x86_64: ami-0ac9e212ac8852729
  • SLES15 x86_64: ami-0218729cdd19e8d66

workaround: install latest Python 3.8 version

Edited by Jérôme Witt