nickjj / ansible-docker

Install / Configure Docker and Docker Compose using Ansible.
MIT License
750 stars 224 forks source link

[Fix] Lxc crash #98

Closed jbsky closed 4 years ago

nickjj commented 4 years ago

Hi,

Thanks for the PR. What distro are you running in your LXC? This role only supports Python 3 btw.

jbsky commented 4 years ago

Hi,

Debian 10, Buster/stable.

nickjj commented 4 years ago

Does it have Python 3 installed and is it bootstrapped to run Ansible?

What is the exact error when you run the role?

I can't reproduce this error on a regular Debian 10 OS or within Docker using Debian 10 as a base.

jbsky commented 4 years ago

Does it have Python 3 installed and is it bootstrapped to run Ansible? Interesting, i.e.?

What is the exact error when you run the role? image

Anyway by passing everything in python 3, on the machine, when I connect, there is python 2.

nickjj commented 4 years ago

You can configure Ansible to use Python 3 by setting ansible_python_interpreter.

Python 2 has been officially end of life for 9 months now. It's highly recommended to use 3 everywhere.

jbsky commented 4 years ago

You can configure Ansible to use Python 3 by setting ansible_python_interpreter.

Python 2 has been officially end of life for 9 months now. It's highly recommended to use 3 everywhere.

So, you have to evolve your readme by adding this as a prerequisite, make sure you are in python 3. Just add in the file ansible.cfg: ansible_python_interpreter=/usr/bin/python3

Indeed, it works better with this adjustment.

nickjj commented 4 years ago

Thanks. Technically you might be able to get it going with Python 2 if you adjust the default variables to use the Python 2 version of the apt packages that get installed. It's just not supported officially.