Skip to content

Fix issue with installation in non-default data_directory on Debian #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rantanevich
Copy link

Hello!

I'm trying to install PostgreSQL on a fresh Ubuntu 22.04 with postgresql_data_directory: /data/postgresql, but I'm getting the following error:

TASK [anxs.postgresql : PostgreSQL | Verify postgresql cluster version] ********
fatal: [postgresql-17]: FAILED! => {"changed": false, "cmd": ["grep", "^17$", "/data/postgresql/PG_VERSION"], "delta": "0:00:00.001677", "end": "2025-06-03 15:31:21.968610", "msg": "non-zero return code", "rc": 2, "start": "2025-06-03 15:31:21.966933", "stderr": "grep: /data/postgresql/PG_VERSION: No such file or directory", "stderr_lines": ["grep: /data/postgresql/PG_VERSION: No such file or directory"], "stdout": "", "stdout_lines": []}

The only workaround I've found is to set postgresql_cluster_reset: true, but that's not very convenient.

Instead, I suggest reinitializing the cluster not only when postgresql_cluster_reset: true, but also when postgresql_data_directory is empty (contains no files or directories).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant