Skip to content
Snippets Groups Projects
Commit 86df04c0 authored by Gabriel Mazetto's avatar Gabriel Mazetto
Browse files

Added support to configure standby_clusters in patroni

parent e8285068
No related branches found
No related tags found
2 merge requests!20Configuration for Mercurial module policy,!18Draft: GitLab 13.5
---
title: Allow bootstrapping patroni Standby Cluster
merge_request: 4558
author:
type: added
......@@ -17,6 +17,12 @@
default['patroni']['use_slots'] = true
default['patroni']['replication_slots'] = {}
# Standby cluster replication settings
default['patroni']['standby_cluster']['enable'] = false
default['patroni']['standby_cluster']['host'] = nil
default['patroni']['standby_cluster']['port'] = 5432
default['patroni']['standby_cluster']['primary_slot_name'] = nil
# Global/Universal settings
default['patroni']['name'] = node.name
default['patroni']['scope'] = 'postgresql-ha'
......
......@@ -3,6 +3,7 @@
DCS_ATTRIBUTES ||= %w(loop_wait ttl retry_timeout maximum_lag_on_failover max_timelines_history master_start_timeout).freeze
DCS_POSTGRESQL_ATTRIBUTES ||= %w(use_pg_rewind use_slots).freeze
DCS_STANDBY_CLUSTER_ATTRIBUTES ||= %w(host port primary_slot_name).freeze
attr_reader :node
......@@ -63,6 +64,14 @@
dcs['slots'][slot_name] = parse_replication_slots_options(options)
end
if node['patroni']['standby_cluster']['enable']
dcs['standby_cluster'] = {}
DCS_STANDBY_CLUSTER_ATTRIBUTES.each do |key|
dcs['standby_cluster'][key] = node['patroni']['standby_cluster'][key]
end
end
dcs
end
......
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