2019-04-26 11:54:14 +02:00
|
|
|
---
|
2023-03-24 13:13:33 +01:00
|
|
|
- name: Geth | Consul | Create service definition
|
2024-03-10 13:32:11 +01:00
|
|
|
include_role: name=infra-role-consul-service
|
2023-03-24 13:13:33 +01:00
|
|
|
vars:
|
|
|
|
consul_config_name: '{{ geth_cont_name }}'
|
2019-04-26 11:54:14 +02:00
|
|
|
consul_services:
|
2022-06-03 11:16:07 +02:00
|
|
|
- id: '{{ geth_cont_name }}'
|
|
|
|
name: '{{ geth_consul_service_name }}'
|
2019-04-26 11:54:14 +02:00
|
|
|
tags: '{{ geth_consul_tags }}'
|
|
|
|
port: '{{ geth_port }}'
|
2021-03-25 12:16:43 +01:00
|
|
|
address: '{{ ansible_host }}'
|
2019-04-26 11:54:14 +02:00
|
|
|
meta:
|
2023-09-12 15:57:21 +02:00
|
|
|
node_addr: '{{ node_info.json.result.id }}'
|
2019-04-26 11:54:14 +02:00
|
|
|
node_enode: '{{ node_info.json.result.enode }}'
|
2023-09-12 15:57:21 +02:00
|
|
|
version: '{{ geth_cont_tag | regex_replace("^v", "") }}'
|
2019-05-06 11:41:21 +02:00
|
|
|
checks:
|
2021-03-25 13:50:04 +01:00
|
|
|
- id: '{{ geth_cont_name }}-status'
|
2019-05-06 11:41:21 +02:00
|
|
|
type: tcp
|
|
|
|
tcp: '127.0.0.1:{{ geth_port }}'
|
2021-03-25 12:16:43 +01:00
|
|
|
|
2024-03-08 11:08:16 +01:00
|
|
|
- id: '{{ geth_cont_name }}-metrics'
|
|
|
|
name: '{{ geth_consul_service_name }}-metrics'
|
|
|
|
tags: '{{ geth_consul_tags + ["metrics"] }}'
|
|
|
|
port: '{{ geth_metrics_port }}'
|
|
|
|
address: '{{ geth_consul_advertised_address }}'
|
|
|
|
disabled: '{{ not geth_metrics_enabled }}'
|
|
|
|
checks:
|
|
|
|
- id: '{{ geth_cont_name }}-metrics-status'
|
2024-03-08 12:13:24 +01:00
|
|
|
type: 'tcp'
|
2024-03-08 11:08:16 +01:00
|
|
|
tcp: 'localhost:{{ geth_metrics_port }}'
|
|
|
|
timeout: '5s'
|
|
|
|
failures_before_critical: 3
|
|
|
|
|
2022-06-03 11:16:07 +02:00
|
|
|
- id: '{{ geth_cont_name }}-rpc'
|
|
|
|
name: '{{ geth_consul_service_name }}-rpc'
|
2019-05-06 11:41:21 +02:00
|
|
|
tags: '{{ geth_consul_tags + ["rpc"] }}'
|
|
|
|
port: '{{ geth_rpc_port }}'
|
2023-05-24 16:45:46 +02:00
|
|
|
address: '{{ geth_consul_advertised_address }}'
|
2023-03-24 13:13:33 +01:00
|
|
|
disabled: '{{ not geth_rpc_enabled }}'
|
2019-05-06 11:41:21 +02:00
|
|
|
meta:
|
2023-05-24 16:45:46 +02:00
|
|
|
url: 'http://{{ geth_consul_advertised_address }}:{{ geth_rpc_port }}'
|
2023-09-12 15:57:21 +02:00
|
|
|
version: '{{ geth_cont_tag | regex_replace("^v", "") }}'
|
2019-04-26 11:54:14 +02:00
|
|
|
checks:
|
2021-03-25 13:50:04 +01:00
|
|
|
- id: '{{ geth_cont_name }}-rpc-status'
|
2021-03-25 13:56:04 +01:00
|
|
|
type: 'script'
|
2021-05-11 12:17:34 +02:00
|
|
|
script: '{{ geth_rpc_wrapper }} eth_syncing'
|
2019-05-08 14:17:36 +02:00
|
|
|
timeout: '5s'
|
2021-10-15 14:35:30 +02:00
|
|
|
failures_before_critical: 3
|
2021-03-25 12:16:43 +01:00
|
|
|
|
2022-08-11 11:42:02 +02:00
|
|
|
- id: '{{ geth_cont_name }}-authrpc'
|
|
|
|
name: '{{ geth_consul_service_name }}-authrpc'
|
|
|
|
tags: '{{ geth_consul_tags + ["authrpc", "engine"] }}'
|
|
|
|
port: '{{ geth_authrpc_port }}'
|
2023-05-24 16:45:46 +02:00
|
|
|
address: '{{ geth_consul_advertised_address }}'
|
2023-03-24 13:13:33 +01:00
|
|
|
disabled: '{{ not geth_authrpc_enabled }}'
|
2022-08-11 11:42:02 +02:00
|
|
|
meta:
|
2023-05-24 16:45:46 +02:00
|
|
|
url: 'http://{{ geth_consul_advertised_address }}:{{ geth_authrpc_port }}'
|
2023-09-12 15:57:21 +02:00
|
|
|
version: '{{ geth_cont_tag | regex_replace("^v", "") }}'
|
2022-08-11 11:42:02 +02:00
|
|
|
checks:
|
|
|
|
- id: '{{ geth_cont_name }}-authrpc-status'
|
|
|
|
type: 'tcp'
|
|
|
|
tcp: 'localhost:{{ geth_authrpc_port }}'
|
|
|
|
failures_before_critical: 3
|
|
|
|
|
2022-06-03 11:16:07 +02:00
|
|
|
- id: '{{ geth_cont_name }}-ws'
|
|
|
|
name: '{{ geth_consul_service_name }}-ws'
|
2020-11-24 15:37:01 +01:00
|
|
|
tags: '{{ geth_consul_tags + ["websocket"] }}'
|
|
|
|
port: '{{ geth_websocket_port }}'
|
2023-05-24 16:45:46 +02:00
|
|
|
address: '{{ geth_consul_advertised_address }}'
|
2023-03-24 13:13:33 +01:00
|
|
|
disabled: '{{ not geth_websocket_enabled }}'
|
2020-11-24 15:37:01 +01:00
|
|
|
meta:
|
2023-05-24 16:45:46 +02:00
|
|
|
url: 'ws://{{ geth_consul_advertised_address }}:{{ geth_websocket_port }}'
|
2023-09-12 15:57:21 +02:00
|
|
|
version: '{{ geth_cont_tag | regex_replace("^v", "") }}'
|
2020-11-24 15:37:01 +01:00
|
|
|
checks:
|
|
|
|
- id: '{{ geth_cont_name }}-ws-status'
|
|
|
|
name: 'Geth WebSocket API'
|
|
|
|
type: 'tcp'
|
|
|
|
tcp: 'localhost:{{ geth_websocket_port }}'
|
2021-10-15 14:35:30 +02:00
|
|
|
failures_before_critical: 3
|
2022-03-07 10:27:52 +01:00
|
|
|
|