add consul service definition
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
80e572044e
commit
bf8662b20f
|
@ -35,6 +35,9 @@ postgres_ha_databases: []
|
|||
# user: 'dbuser'
|
||||
# pass: 'dbpass'
|
||||
|
||||
# Consul
|
||||
postgres_ha_consul_service: 'postgres'
|
||||
|
||||
# general container management
|
||||
compose_recreate: 'smart'
|
||||
compose_state: 'present'
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
- name: Create Consul service definition
|
||||
include_role: name=consul-service
|
||||
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:
|
||||
- id: '{{ postgres_ha_service_name }}-status'
|
||||
name: 'PostgreSQL DB Healthcheck'
|
||||
type: 'tcp'
|
||||
tcp: 'localhost:{{ postgres_ha_cont_port }}'
|
|
@ -20,3 +20,5 @@
|
|||
with_items: '{{ postgres_ha_databases }}'
|
||||
loop_control:
|
||||
loop_var: db
|
||||
|
||||
- import_tasks: consul.yml
|
||||
|
|
Loading…
Reference in New Issue