Turgon37 / ansible-apache2

Ansible role to install and configure apache2 webserver
MIT License
1 stars 2 forks source link

apache2.facts.py & apache2-server-status.py need change to allow python3 #17

Open jwhimpel opened 3 years ago

jwhimpel commented 3 years ago

Both files/apache2.facts.py and files/apache2-server-status.py begin with:

!/usr/bin/env python

Under Ubuntu 18_04 on the ansible host (not controller) that yields an empty return and the task named "Create apache2__version variable" dies.

If I change the beginning line to read:

!/usr/bin/env python3

Everything works as I would expect it to work.

I do not grok enough python to know to fix the issue such that the files work with both python2 and python3. I will leave that exercise to the publisher of the role.

bet0x commented 2 years ago

Kind of late with my comment but:

  1. Set your Python version (python will alias to whatever you set):

    sudo update-alternatives  --set python /usr/bin/pythonXXX
  2. Or update your default Python installation:

    sudo update-alternatives --config python