2022-11-24 19:43:14 +00:00
|
|
|
---
|
|
|
|
- name: Create Consul service definition
|
2023-11-23 11:50:00 +00:00
|
|
|
include_role: name=infra-role-consul-service
|
2022-11-24 19:43:14 +00:00
|
|
|
vars:
|
|
|
|
consul_config_name: '{{ postgres_ha_service_name }}'
|
|
|
|
consul_services:
|
|
|
|
- id: '{{ postgres_ha_service_name }}'
|
|
|
|
name: '{{ postgres_ha_consul_service }}'
|
|
|
|
tags: ['postgres', 'database']
|
|
|
|
port: '{{ postgres_ha_cont_port }}'
|
|
|
|
checks:
|
2023-11-22 11:33:35 +00:00
|
|
|
- id: '{{ postgres_ha_service_name }}-status'
|
|
|
|
name: 'PostgreSQL DB Healthcheck'
|
|
|
|
type: 'tcp'
|
|
|
|
tcp: 'localhost:{{ postgres_ha_cont_port }}'
|
|
|
|
|
2023-11-23 12:37:22 +00:00
|
|
|
- id: '{{ postgres_ha_service_name }}-{{ postgres_ha_replica_enabled | ternary("replica", "tables") }}'
|
2023-11-23 12:07:56 +00:00
|
|
|
name: 'PostgreSQL {{ postgres_ha_replica_enabled | ternary("Replica", "Tables") }} Healthcheck'
|
2023-11-22 11:33:35 +00:00
|
|
|
type: 'script'
|
|
|
|
script: '{{ postgres_ha_service_path }}/health.sh'
|