consul: make optional services actually optional
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
293ebe5505
commit
a41900b07a
|
@ -1,6 +1,8 @@
|
||||||
---
|
---
|
||||||
- name: Geth | Consul | Define services
|
- name: Geth | Consul | Create service definition
|
||||||
set_fact:
|
include_role: name=consul-service
|
||||||
|
vars:
|
||||||
|
consul_config_name: '{{ geth_cont_name }}'
|
||||||
consul_services:
|
consul_services:
|
||||||
- id: '{{ geth_cont_name }}'
|
- id: '{{ geth_cont_name }}'
|
||||||
name: '{{ geth_consul_service_name }}'
|
name: '{{ geth_consul_service_name }}'
|
||||||
|
@ -20,6 +22,7 @@
|
||||||
tags: '{{ geth_consul_tags + ["rpc"] }}'
|
tags: '{{ geth_consul_tags + ["rpc"] }}'
|
||||||
port: '{{ geth_rpc_port }}'
|
port: '{{ geth_rpc_port }}'
|
||||||
address: '{{ ansible_local.wireguard.address }}'
|
address: '{{ ansible_local.wireguard.address }}'
|
||||||
|
disabled: '{{ not geth_rpc_enabled }}'
|
||||||
meta:
|
meta:
|
||||||
url: 'http://{{ ansible_local.wireguard.address }}:{{ geth_rpc_port }}'
|
url: 'http://{{ ansible_local.wireguard.address }}:{{ geth_rpc_port }}'
|
||||||
checks:
|
checks:
|
||||||
|
@ -34,6 +37,7 @@
|
||||||
tags: '{{ geth_consul_tags + ["authrpc", "engine"] }}'
|
tags: '{{ geth_consul_tags + ["authrpc", "engine"] }}'
|
||||||
port: '{{ geth_authrpc_port }}'
|
port: '{{ geth_authrpc_port }}'
|
||||||
address: '{{ ansible_local.wireguard.address }}'
|
address: '{{ ansible_local.wireguard.address }}'
|
||||||
|
disabled: '{{ not geth_authrpc_enabled }}'
|
||||||
meta:
|
meta:
|
||||||
url: 'http://{{ ansible_local.wireguard.address }}:{{ geth_authrpc_port }}'
|
url: 'http://{{ ansible_local.wireguard.address }}:{{ geth_authrpc_port }}'
|
||||||
checks:
|
checks:
|
||||||
|
@ -47,6 +51,7 @@
|
||||||
tags: '{{ geth_consul_tags + ["websocket"] }}'
|
tags: '{{ geth_consul_tags + ["websocket"] }}'
|
||||||
port: '{{ geth_websocket_port }}'
|
port: '{{ geth_websocket_port }}'
|
||||||
address: '{{ ansible_local.wireguard.address }}'
|
address: '{{ ansible_local.wireguard.address }}'
|
||||||
|
disabled: '{{ not geth_websocket_enabled }}'
|
||||||
meta:
|
meta:
|
||||||
url: 'ws://{{ ansible_local.wireguard.address }}:{{ geth_websocket_port }}'
|
url: 'ws://{{ ansible_local.wireguard.address }}:{{ geth_websocket_port }}'
|
||||||
checks:
|
checks:
|
||||||
|
@ -56,13 +61,3 @@
|
||||||
tcp: 'localhost:{{ geth_websocket_port }}'
|
tcp: 'localhost:{{ geth_websocket_port }}'
|
||||||
failures_before_critical: 3
|
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 }}'
|
|
||||||
|
|
Loading…
Reference in New Issue