consul: make WebSocket optional in Consul services

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-03-07 10:27:52 +01:00
parent 2689c6ccae
commit e7cef83dd8
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
1 changed files with 13 additions and 4 deletions

View File

@ -1,8 +1,6 @@
---
- name: Geth | Create Consul service definition
include_role: name=consul-service
vars:
consul_config_name: '{{ geth_cont_name }}'
- name: Geth | Consul | Define services
set_fact:
consul_services:
- name: '{{ geth_cont_name }}'
tags: '{{ geth_consul_tags }}'
@ -41,3 +39,14 @@
type: 'tcp'
tcp: 'localhost:{{ geth_websocket_port }}'
failures_before_critical: 3
- name: Geth | Consul | Remove WebSocket service
set_fact:
consul_services: |
{{ consul_services | rejectattr('name', 'match', '.*-ws$') | list }}
when: not geth_websocket_enabled
- name: Geth | Consul | Create service definition
include_role: name=consul-service
vars:
consul_config_name: '{{ geth_cont_name }}'