infra-role-geth/tasks/consul.yml

46 lines
1.5 KiB
YAML

---
- name: Geth | Create Consul service definition
include_role: name=consul-service
vars:
consul_config_name: '{{ geth_cont_name }}'
consul_services:
- name: '{{ geth_cont_name }}'
tags: '{{ geth_consul_tags }}'
port: '{{ geth_port }}'
address: '{{ ansible_host }}'
meta:
env: '{{ env }}'
stage: '{{ stage }}'
node_addr: '{{ node_info.json.result.id }}'
node_enode: '{{ node_info.json.result.enode }}'
checks:
- id: '{{ geth_cont_name }}-status'
type: tcp
tcp: '127.0.0.1:{{ geth_port }}'
- name: '{{ geth_cont_name }}-rpc'
tags: '{{ geth_consul_tags + ["rpc"] }}'
port: '{{ geth_rpc_port }}'
address: '{{ ansible_local.wireguard.vpn_ip }}'
meta:
env: '{{ env }}'
stage: '{{ stage }}'
checks:
- id: '{{ geth_cont_name }}-rpc-status'
type: 'script'
script: '{{ geth_rpc_wrapper }} eth_syncing'
timeout: '5s'
- name: '{{ geth_cont_name }}-ws'
tags: '{{ geth_consul_tags + ["websocket"] }}'
port: '{{ geth_websocket_port }}'
address: '{{ ansible_local.wireguard.vpn_ip }}'
meta:
env: '{{ env }}'
stage: '{{ stage }}'
checks:
- id: '{{ geth_cont_name }}-ws-status'
name: 'Geth WebSocket API'
type: 'tcp'
tcp: 'localhost:{{ geth_websocket_port }}'