Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion ansible/inventory/offline/99-static
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,19 @@

[postgresql:vars]
postgresql_network_interface = enp1s0

repmgr_node_config:
postgresql1: # Maps to postgresql_rw group
node_id: 1
priority: 150
role: primary
postgresql2: # Maps to first postgresql_ro
node_id: 2
priority: 100
role: standby
postgresql3: # Maps to second postgresql_ro
node_id: 3
priority: 50
role: standby

[elasticsearch:vars]
# elasticsearch_network_interface = enp1s0
Expand Down
15 changes: 2 additions & 13 deletions ansible/inventory/offline/group_vars/postgresql/postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,8 @@ repmgr_namespace: "{{ wire_namespace | default('default') }}"
wire_pg_secret_name: "wire-postgresql-external-secret"

# Node configuration for repmgr
repmgr_node_config:
postgresql1: # Maps to postgresql_rw group
node_id: 1
priority: 150
role: primary
postgresql2: # Maps to first postgresql_ro
node_id: 2
priority: 100
role: standby
postgresql3: # Maps to second postgresql_ro
node_id: 3
priority: 50
role: standby
# NOTE: repmgr_node_config is defined in the inventory file ansible/inventory/offline/99-static, ansible/inventory/offline/staging.yml and terraform/examples/wire-server-deploy-offline-hetzner/outputs.tf
# to allow environment-specific node mappings. Do not define here.

# repmgr settings
# repmgrd monitoring and reconnection configuration
Expand Down
17 changes: 15 additions & 2 deletions ansible/inventory/offline/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ k8s-cluster:
kube-master: {}

datanodes:
# host names here must match each node's actual hostname
# its a requirement for rabbitmq
hosts:
datanode1:
ansible_host: "datanode1_ip"
Expand Down Expand Up @@ -76,6 +74,8 @@ minio:

rmq-cluster:
children:
# host names here must match each node's actual hostname
# its a requirement for rabbitmq
datanodes: {}
vars:
rabbitmq_network_interface: enp1s0
Expand All @@ -88,6 +88,19 @@ postgresql:
vars:
wire_dbname: wire-server
postgresql_network_interface: enp1s0
repmgr_node_config:
datanode1: # Maps to postgresql_rw group
node_id: 1
priority: 150
role: primary
datanode2: # Maps to first postgresql_ro
node_id: 2
priority: 100
role: standby
datanode3: # Maps to second postgresql_ro
node_id: 3
priority: 50
role: standby

postgresql_rw:
hosts:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed: remove repmgr_node_config from group_vars and put with node inventory
14 changes: 13 additions & 1 deletion offline/postgresql-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,19 @@ postgresql3 ansible_host=192.168.122.206

[postgresql:vars]
postgresql_network_interface = enp1s0

repmgr_node_config:
postgresql1: # Maps to postgresql_rw group
node_id: 1
priority: 150
role: primary
postgresql2: # Maps to first postgresql_ro
node_id: 2
priority: 100
role: standby
postgresql3: # Maps to second postgresql_ro
node_id: 3
priority: 50
role: standby

# All PostgreSQL nodes
[postgresql]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,23 @@ output "static-inventory" {
vars = {
wire_dbname = "wire-server"
postgresql_network_interface = "enp7s0"
repmgr_node_config = {
postgresql1 = {
node_id = 1
priority = 150
role = "primary"
}
postgresql2 = {
node_id = 2
priority = 100
role = "standby"
}
postgresql3 = {
node_id = 3
priority = 50
role = "standby"
}
}
}
}
postgresql_rw = {
Expand Down
Loading