Skip to content
Snippets Groups Projects
Commit eae1c794 authored by Hossein Pursultani's avatar Hossein Pursultani
Browse files

Reload PostgreSQL configuration when Patroni is enabled

parent f739b6b2
No related branches found
No related tags found
1 merge request!13GitLab 13.4
---
title: Reload PostgreSQL configuration when Patroni is enabled
merge_request: 4548
author:
type: fixed
......@@ -97,6 +97,24 @@
end
end
execute 'reload postgresql' do
command "#{patroni_helper.ctl_command} -c #{patroni_config_file} reload --force #{node['patroni']['scope']} #{node['patroni']['name']}"
only_if { patroni_helper.node_status == 'running' }
action :nothing
end
Dir["#{node['patroni']['data_dir']}/*"].each do |src|
file "#{node['postgresql']['data_dir']}/#{File.basename(src)}" do
owner account_helper.postgresql_user
group account_helper.postgresql_group
mode format('%o', File.new(src).stat.mode)[-5..-1]
content lazy { File.open(src).read }
sensitive !!(File.extname(src) =~ /\.(key|crt)/)
only_if { patroni_helper.bootstrapped? }
notifies :run, 'execute[reload postgresql]', :delayed
end
end
database_objects 'patroni' do
pg_helper pg_helper
account_helper account_helper
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment