postgresql - installing postgres via puppet with customer data_directory -


i'm trying install postgres 9.1 on ubuntu 12.04 machine using puppet v3.4.3 , puppetlabs/postgresql module v3.3.0. want data_directory point large disk i've mounted.

if change datadir property of postgresql::globals doesn't seem anything. postgres.conf file still has data_directory pointing /var/lib/postgresql/9.1/main tried using postgresql::server::config_entry change data_directory param in postgres.config gives following error:

debug: executing 'service postgresql reload' notice: /stage[main]/postgresql::server::reload/exec[postgresql_reload]/returns:  * reloading postgresql 9.1 database server notice: /stage[main]/postgresql::server::reload/exec[postgresql_reload]/returns:  * pg_ctl: pid file "/data/pgdata/postmaster.pid" not exist notice: /stage[main]/postgresql::server::reload/exec[postgresql_reload]/returns: server running? notice: /stage[main]/postgresql::server::reload/exec[postgresql_reload]/returns:    ...fail! error: /stage[main]/postgresql::server::reload/exec[postgresql_reload]: failed call refresh: service postgresql reload returned 1 instead of 1 of [0] error: /stage[main]/postgresql::server::reload/exec[postgresql_reload]: service postgresql reload returned 1 instead of 1 of [0] 

i believe fails because postgres started before configuring data_directory, , parameter part of startup of process when change value can no longer find process stop , start it. if kill postgres , try start error saying /data/pgdata not valid directory, database not created in data_directory location specified.

finally tried creating user, group , file path, , mounting disk /var/lib/postgresql/9.1/main in puppet before puppet installs postgres, error:

notice: /stage[main]/mm_postgres::server/postgresql::server::config_entry[checkpoint_segments]/postgresql_conf[checkpoint_segments]/ensure: created error: puppet::util::filetype::filetypeflat not write /etc/postgresql/9.1/main/postgresql.conf: no such file or directory - /etc/postgresql/9.1/main/postgresql.conf error: /stage[main]/mm_postgres::server/postgresql::server::config_entry[checkpoint_segments]/postgresql_conf[checkpoint_segments]: not evaluate: puppet::util::filetype::filetypeflat not write /etc/postgresql/9.1/main/postgresql.conf: no such file or directory - /etc/postgresql/9.1/main/postgresql.conf 

i believe done in correct order, , permissions fine, i'll keep looking this. know if possible install postgres via puppet on ubuntu , change data_directory, , if so, how?

thanks

problem postgresql module puppetlabs doesn't quite work kind of customization. think there bug reports out there. did, , works without problem:

file { '/data/postgresql':   ensure => directory, } file { '/var/lib/postgresql':   ensure  => link,   target  => '/data/postgresql',   before  => class['::postgresql::server::install'], }  class { '::postgresql::globals': }->class { '::postgresql::server': } 

hope helps!

ps. used puppetlabs-postgresql version 3.3.3


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -