Closed mgedmin closed 3 years ago
Current status:
FATAL: password authentication failed for user \"postgres\"
while running manage.py migrate
(why manage.py and not django-admin migrate? anyway).
I suspect there's a settings.py somewhere that incorrectly tells django to use user postgres
instead of ubuntult
. And indeed, /opt/ubuntu.lt/spirit/project/settings.dev.py has
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'HOST': '127.0.0.1',
'NAME': 'ubuntult',
'USER': 'postgres',
'PASSWORD': 'secret',
}
}
Is dev.py the right settings file to use for production? If not, then why does /opt/ubuntu.lt/spirit/manage.py do
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings.dev")
?
Hm, I found a /opt/ubuntu.lt/.env with a bunch of interesting environment variables (with names containing SECRET in a world-readable file, anyway, moving along). which gives me an idea.
The idea that I had: https://github.com/akllt/infrastructure/pull/10
Hm, I found a /opt/ubuntu.lt/.env with a bunch of interesting environment variables (with names containing SECRET in a world-readable file, anyway, moving along).
Fixed .env
file permissions.
Also
The inventory file is specified in ansible.cfg by using 'inventory', not 'hostfile'
Ask for Python 3 by default on the target via interpreter_python = auto
Fix warning about using reserved variable name 'name' (the variable was unused)
Pass lists to apt module instead of looping
Use Python 3 versions of dependencies (e.g. python-psycopg2 doesn't even exist in Ubuntu 20.04 LTS, but python3-psycopg2 does)
Python 3.8 is already available in Ubuntu 20.04 LTS, so drop the unfinished pyenv bits (and suggest deadsnakes instead, in case it ever becomes necessary to use a Python 3 version not shipped by Ubuntu)
There was a typo in a task description
The letsencrypt client was renamed to certbot long ago
Apache config files should live in sites-available; sites-enabled should contain symlinks only