File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 7373 before => Class[' postgresql::server::reload' ],
7474 }
7575 }
76+
77+ if $name == ' data_directory' {
78+ augeas { 'override PGDATA in /etc/sysconfig/pgsql/postgresql' :
79+ lens => ' Shellvars.lns' ,
80+ incl => ' /etc/sysconfig/pgsql/*' ,
81+ context => ' /files/etc/sysconfig/pgsql/postgresql' ,
82+ changes => " set PGDATA ${value} " ,
83+ require => File [' /etc/sysconfig/pgsql/postgresql' ],
84+ notify => Class[' postgresql::server::service' ],
85+ before => Class[' postgresql::server::reload' ],
86+ }
87+ }
7688 }
7789 }
7890
Original file line number Diff line number Diff line change 1+ require 'spec_helper_acceptance'
2+
3+ # These tests ensure that postgres can change itself to an alternative pgdata
4+ # location properly.
5+ describe 'postgres::server' , :unless => UNSUPPORTED_PLATFORMS . include? ( fact ( 'osfamily' ) ) do
6+ it 'on an alternative pgdata location' do
7+ pp = <<-EOS
8+ class { 'postgresql::server': data_directory => '/var/pgsql' }
9+ EOS
10+
11+ apply_manifest ( pp , :catch_failures => true )
12+ apply_manifest ( pp , :catch_changes => true )
13+ end
14+
15+ it 'can connect with psql' do
16+ psql ( '--command="\l" postgres' , 'postgres' ) do |r |
17+ expect ( r . stdout ) . to match ( /List of databases/ )
18+ end
19+ end
20+
21+ end
22+
23+
24+
You can’t perform that action at this time.
0 commit comments