ricsanfre / ansible-role-minio

Ansible role for installing and configuring Minio

Home Page:https://galaxy.ansible.com/ricsanfre/minio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No package matching 'python-is-python3' is available" on Debian buster

yoshikakbudto opened this issue · comments

I've got the error installing minio client on this system:

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster


TASK [ricsanfre.minio : Ensure PIP is installed.] ***************************************************************************************************************************************************************
fatal: [debian.my.local]: FAILED! => {"changed": false, "msg": "No package matching 'python-is-python3' is available"}

The role only has been tested for Ubuntu 20.04. Other releases of Ubuntu or other OS are not currently supported
Role should be tested and updated to use Debian distributions.

Related to python-is-python3 package

From:
https://packages.debian.org/bullseye/python-is-python3

"Starting with the Debian 11 (bullseye) and Ubuntu 20.04 LTS (focal) releases, all python packages use explicit python3 or python2 interpreter and do not use unversioned /usr/bin/python at all.
python-is-python3 is is a convenience package which ships a symlink to point the /usr/bin/python interpreter at the current default python3"

This is needed by the minio python module (minio_buckert.py) which makes uses of /usr/bin/python interpreter.

Ansible's automatic python interpreter discovery should select the proper interpreter installed in the server and use it with any module that is executed.

But for this to work the python module must start by #!/usr/bin/python and if the python script starts with #!/usr/bin/env python automatic interpreter replacement is not working. See Ansible's module development documentation, where it is stated that:

Begin your Ansible module with #!/usr/bin/python - this “shebang” allows ansible_python_interpreter to work. Follow the shebang immediately with # -- coding: utf-8 -- to clarify that the file is UTF-8 encoded.
Using #!/usr/bin/env, makes env the interpreter and bypasses ansible__interpreter logic.

Changing the shebang in the python script removes the need for python-is-python3 package.