postgresql
postgresql copied to clipboard
Custom data directory only works on redhat
I tried changing the data directory on a ubuntu install, and it failed miserably, read the playbook. only supported on redhat.
@macnibblet I had the same issue; I forked and got it working so feel free to take a look: https://github.com/briandbecker/ansible-role-postgresql
@macnibblet , what about postgresql_cluster_reset variable? You can set it to true and cluster will be created in new postgresql_data_directory (if cluster exists, it will be dropped):
https://github.com/ANXS/postgresql/blob/master/tasks/configure.yml#L36-L49
Tested on Debian and Ubuntu.
@merifri Haven't tested but reading the source, I don't think setting postgresql_cluster_reset=true will drop an existing cluster (under Debian). The task that drops the cluster checks for 'pgdata_dir_exist.changed' before running (which will be false if the data data directory already exists).
@macnibblet it's supposed to be supported on Debian but I couldn't get it working on Ubuntu (xenial). Issue seems to be with pg_createcluster and pg_dropcluster commands in tasks/configure.yml. I've made a pull request with the fix that worked for me here: https://github.com/ANXS/postgresql/pull/237
is this still an issue?
I tried using a non-standard directory on Debian 14.04 today, and it broke. :o( Once we get #288 merged, then we can add this to the Travis tests, and confirm it's working or broken.