consul: add ENR address to service metadata
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
a97db210ce
commit
e448cb369a
|
@ -61,3 +61,4 @@ nimbus_fluffy_rpc_port: 9900
|
||||||
nimbus_fluffy_consul_service_name: 'nimbus-fluffy'
|
nimbus_fluffy_consul_service_name: 'nimbus-fluffy'
|
||||||
nimbus_fluffy_consul_service_file_name: '{{ nimbus_fluffy_service_name | replace("-", "_") }}'
|
nimbus_fluffy_consul_service_file_name: '{{ nimbus_fluffy_service_name | replace("-", "_") }}'
|
||||||
nimbus_fluffy_consul_metrics_service_name: '{{ nimbus_fluffy_consul_service_name }}-metrics'
|
nimbus_fluffy_consul_metrics_service_name: '{{ nimbus_fluffy_consul_service_name }}-metrics'
|
||||||
|
nimbus_fluffy_consul_url: 'http://localhost:8500/v1/catalog'
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
---
|
---
|
||||||
|
- name: Query node ENR address
|
||||||
|
uri:
|
||||||
|
url: 'http://localhost:{{ nimbus_fluffy_rpc_port }}/'
|
||||||
|
method: 'POST'
|
||||||
|
body_format: 'json'
|
||||||
|
body:
|
||||||
|
id: 1
|
||||||
|
jsonrpc: '2.0'
|
||||||
|
method: 'discv5_nodeInfo'
|
||||||
|
params: []
|
||||||
|
register: node_info_raw
|
||||||
|
|
||||||
|
- name: Extract node ENR address
|
||||||
|
set_fact:
|
||||||
|
nimbus_fluffy_node_enr: '{{ node_info_raw.json.result.nodeENR }}'
|
||||||
|
|
||||||
- name: 'Create Consul service definition'
|
- name: 'Create Consul service definition'
|
||||||
include_role: name=consul-service
|
include_role: name=consul-service
|
||||||
vars:
|
vars:
|
||||||
|
@ -9,6 +25,8 @@
|
||||||
port: '{{ nimbus_fluffy_listening_port }}'
|
port: '{{ nimbus_fluffy_listening_port }}'
|
||||||
address: '{{ nimbus_fluffy_public_address }}'
|
address: '{{ nimbus_fluffy_public_address }}'
|
||||||
tags: ['{{ env }}.{{ stage }}', 'eth1', 'nimbus']
|
tags: ['{{ env }}.{{ stage }}', 'eth1', 'nimbus']
|
||||||
|
meta:
|
||||||
|
node_enr: '{{ nimbus_fluffy_node_enr }}'
|
||||||
checks:
|
checks:
|
||||||
- name: '{{ nimbus_fluffy_consul_service_name }}-health'
|
- name: '{{ nimbus_fluffy_consul_service_name }}-health'
|
||||||
type: 'script'
|
type: 'script'
|
||||||
|
|
Loading…
Reference in New Issue