diff --git a/defaults/main.yml b/defaults/main.yml index 2e3f77e..7ab2f05 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -61,6 +61,7 @@ geth_public_addr: '{{ ansible_host }}' # Consul config geth_consul_address: '{{ ansible_host }}' +geth_consul_rpc_address: '{{ ansible_local.tinc.vpn_ip }}' geth_consul_enabled: true geth_consul_default_tags: - geth diff --git a/tasks/consul.yml b/tasks/consul.yml index 9f0407b..71ea972 100644 --- a/tasks/consul.yml +++ b/tasks/consul.yml @@ -27,6 +27,17 @@ 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: '{{ geth_consul_rpc_address }}' + meta: + env: '{{ env }}' + stage: '{{ stage }}' checks: - id: '{{ geth_cont_name }}-rpc-status' type: script