parent
b22a7e3c0f
commit
80c7263a72
@ -37,6 +37,19 @@ service postgresql_service do
|
|||||||
action [:enable]
|
action [:enable]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# This will only be run once, if the /var/lib/postgresql/10/main directory
|
||||||
|
# exists. The old data directory is then moved.
|
||||||
|
execute "upgrade postgresql to 12" do
|
||||||
|
command <<-EOF
|
||||||
|
systemctl stop postgresql@12-main
|
||||||
|
systemctl stop postgresql@10-main
|
||||||
|
su - postgres -c "/usr/lib/postgresql/12/bin/pg_upgrade --old-bindir=/usr/lib/postgresql/10/bin/ --new-bindir=/usr/lib/postgresql/12/bin/ --old-datadir=/etc/postgresql/10/main/ --new-datadir=/etc/postgresql/12/main/"
|
||||||
|
mv /var/lib/postgresql/10/main /var/lib/postgresql/10/main.old
|
||||||
|
systemctl start postgresql@12-main
|
||||||
|
EOF
|
||||||
|
only_if { ::File.exist? "/var/lib/postgresql/10/main" }
|
||||||
|
end
|
||||||
|
|
||||||
postgresql_replicas.each do |replica|
|
postgresql_replicas.each do |replica|
|
||||||
postgresql_access "#{replica[:hostname]} replication" do
|
postgresql_access "#{replica[:hostname]} replication" do
|
||||||
access_type "host"
|
access_type "host"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user