Closed gloomytrousers closed 2 years ago
You try to add ansible_python_interpreter: python3
in the group_vars or in the inventory file?
Thank you @xlejo, that solved it.
Not sure whether to close this issue, or if it's something that needs to be documented - anyone have any thoughts?
@xlejo is right, this is the way to specify the python version to use on target systems. Alternatively the default python version can be set with alternatives
, however for some distros this can interfere with certain applications that might use a shebang of #!/usr/bin/python
and expecting to get python 2.
The reason for targeting python 3 is due to some inconsistencies in Ansible behaviour when python 2 is used. I had one issue that I've previously worked around for this role because of this. Given v2 is EOL, it made sense to try and push for python 3 usage.
It probably needs some documentation, I'll have a look into it when I get some time.
I wonder if just documenting that ansible_python_interpreter: python3
should be added to the group vars so that the burden is on the user 🤔
thoughts? @onedr0p @xanmanning ?
looks like @xanmanning already tackled this in https://github.com/PyratLabs/ansible-role-k3s/commit/2e5dd3cc07881846265b855616a6181b135adff4#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
marking this as closed
Summary
Playbook fails on Raspberry Pi OS (buster) with "Python v2.7.16 is not supported by this role. Please install >= v3.6."
However, Python 3 is installed, it's just not the default for the
python
command.Issue Type
Controller Environment and Configuration
This is using the newly-released version 3.0.0 of the role, which mentions "Minimum python version on targets is 3.6" as a breaking change.
Steps to Reproduce
Run a playbook which includes the role (I am running it with
--check
but I don't expect that makes any difference).Expected Result
Playbook succeeds
Actual Result