Awx: installer inventory specified /tmp/pgdocker as a PG database location

Created on 27 Mar 2018  路  5Comments  路  Source: ansible/awx

ISSUE TYPE

  • Bug Report
COMPONENT NAME
  • Installer
SUMMARY

When using the install.yml playbook for a local docker install, the postgres database is placed in /tmp/pgdocker. On CentOS/RedHat machines, tmpclean will remove these files within a few weeks, rendering the database inoperable.

ENVIRONMENT
  • AWX version: 1.0.4
  • AWX install method: docker on linux
  • Ansible version: 2.4.1
  • Operating System:
  • Web Browser:
STEPS TO REPRODUCE

Run a regular local docker install.

EXPECTED RESULTS

Expected the postgres database to be placed somewhere safer, or for there to be a safer default value.

Leaving the value unset and having a volume within the postgres docker container seems preferable to declaring /tmp/pgdocker by default.

installer bug

Most helpful comment

We absolutely expect users to read the INSTALL.md in its entirety before installing awx.

Found at customer site:

$ du -sch /tmp/pgdocker 2.5G /tmp/pgdocker 2.5G total

The documentation states:

https://github.com/ansible/awx/blob/devel/INSTALL.md#postgresql-1

AWX requires access to a PostgreSQL database, and by default, one will be created and deployed in a container, and data will be persisted to a host volume. In this scenario, you must set the value of postgres_data_dir to a path that can be mounted to the container. When the container is stopped, the database files will still exist in the specified path.

I have 2 issues with this:

  • The data is NOT "persisted" by default, it is written to /tmp which does not persist data by design
  • I must set this variable, but if I don't set it, it is still set to a default value instead of failing the play alltogether.

I'd like to see the play fail with a meaningful error message if postgres_data_dir is not set and if you want to keep a default value for that directory for some reason, I'd propose something in /srv but definitely not /tmp as this is not a place that persists data by default.

All 5 comments

I believe this was discuss in IRC and the answer was that if you want to save your db then use an external db.

or just modify the directory in the inventory file to put it in another location.

I hope you'll reconsider. A user that doesn't read through all of the install vars or accepts that setting at face value will have a non-functioning install within a couple of weeks because of systemd-tmpfiles.service (on CentOS/RHEL 7, at least).

Hello dantheta,

Thanks for reaching out.

We absolutely expect users to read the INSTALL.md in its entirety before installing awx. The INSTALL.md deliberately instructs the reader to review the inventory file and its variables before building or installing awx for exactly this purpose.

We absolutely expect users to read the INSTALL.md in its entirety before installing awx.

Found at customer site:

$ du -sch /tmp/pgdocker 2.5G /tmp/pgdocker 2.5G total

The documentation states:

https://github.com/ansible/awx/blob/devel/INSTALL.md#postgresql-1

AWX requires access to a PostgreSQL database, and by default, one will be created and deployed in a container, and data will be persisted to a host volume. In this scenario, you must set the value of postgres_data_dir to a path that can be mounted to the container. When the container is stopped, the database files will still exist in the specified path.

I have 2 issues with this:

  • The data is NOT "persisted" by default, it is written to /tmp which does not persist data by design
  • I must set this variable, but if I don't set it, it is still set to a default value instead of failing the play alltogether.

I'd like to see the play fail with a meaningful error message if postgres_data_dir is not set and if you want to keep a default value for that directory for some reason, I'd propose something in /srv but definitely not /tmp as this is not a place that persists data by default.

Was this page helpful?
0 / 5 - 0 ratings