Open Taubin opened 1 year ago
Reading here may help: https://stackoverflow.com/questions/51622712/ansible-requires-python-apt-but-its-already-installed
You can try ansible_python_interpreter=/usr/bin/python3
in your hosts
file, instead of using /usr/bin/python
.
You can SSH into the server and see what /usr/bin/python --version
and what /usr/bin/python3 --version
say.
Thank you for that, it's at least gotten me a step farther:
ansible-playbook -i inventory/hosts setup.yml --tags=setup-all,ensure-matrix-users-created,start
PLAY [Set up a Matrix server] ********************************************************************************************************************************************
TASK [Gathering Facts] ***************************************************************************************************************************************************
fatal: [matrix.[redacted]]: FAILED! => changed=false
ansible_facts: {}
failed_modules:
ansible.legacy.setup:
failed: true
module_stderr: |-
sudo: a password is required
module_stdout: ''
msg: |-
MODULE FAILURE
See stdout/stderr for the exact error
rc: 1
msg: |-
The following modules failed to execute: ansible.legacy.setup
PLAY RECAP ***************************************************************************************************************************************************************
matrix.[redacted] : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
Removed become=true user=sudo
Unfortunately I'm running into the same error after changing /usr/bin/python to /usr/bin/python3
I'm getting this same error after an update. Did you manage to fix it somehow? The package is installed and visible from python3, making this very confusing.
Playbook Configuration:
My
vars.yml
file looks like this:Matrix Server:
Ansible: If your problem appears to be with Ansible, tell us:
ansible --version
)Problem description:
Running the playbook to upgrade, I receive the following error:
python3-apt must be installed and visible from /usr/bin/python.
Full output:
My hosts file is below:
Python3-apt is installed:
Describe what you're doing, what you expect to happen and what happens instead here. Tell us what you've tried and what you're aiming to achieve.
I am attempting to upgrade my installation using the instructions here
I haven't upgraded in a while so it's entirely possible it's something dumb I'm missing and if so I sincerely apologize. I have tried googling to fix this on my own, however the answers I've found have not worked. Including reinstalling pip, reinstalling apt and adding a symlink:
sudo cp apt_pkg.cpython-34m-i386-linux-gnu.so apt_pkg.so
Additional context Add any other context about the problem here.