postgresql icon indicating copy to clipboard operation
postgresql copied to clipboard

Custom data directory only works on redhat

Open awartoft opened this issue 8 years ago • 7 comments

I tried changing the data directory on a ubuntu install, and it failed miserably, read the playbook. only supported on redhat.

awartoft avatar Apr 04 '17 15:04 awartoft

@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

briandbecker avatar Apr 04 '17 17:04 briandbecker

@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 avatar Apr 10 '17 15:04 merifri

@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).

corford avatar Apr 16 '17 15:04 corford

@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

corford avatar Apr 16 '17 16:04 corford

is this still an issue?

aoyawale avatar Mar 30 '18 22:03 aoyawale

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.

gclough avatar Apr 03 '18 23:04 gclough