2021-04-19 18:21:42 +00:00
|
|
|
---
|
2021-05-19 09:54:46 +00:00
|
|
|
- name: Find available data centers
|
2021-04-19 18:21:42 +00:00
|
|
|
uri:
|
2021-05-19 09:54:46 +00:00
|
|
|
url: '{{ consul_catalog_url }}/datacenters'
|
|
|
|
register: data_centers
|
|
|
|
|
|
|
|
- name: Find available geth websocket services
|
|
|
|
uri:
|
|
|
|
url: '{{ consul_catalog_url }}/service/{{ web3_geth_node_consul_name }}?dc={{ item }}'
|
|
|
|
with_items: '{{ data_centers.json }}'
|
|
|
|
register: geth_ws_services
|
|
|
|
|
|
|
|
- name: Extract Geth websocket IP and port
|
|
|
|
set_fact:
|
|
|
|
geth_ws_addresses: |
|
|
|
|
{{ geth_ws_services.results
|
|
|
|
| sum(attribute="json", start=[])
|
|
|
|
| json_query("[].[ServiceAddress, ServicePort]")
|
|
|
|
| map('join', ':')
|
|
|
|
| list }}
|
2021-04-19 18:21:42 +00:00
|
|
|
|
|
|
|
- name: Extract Goerli Geth WebSocket URL
|
|
|
|
set_fact:
|
2021-05-19 09:54:46 +00:00
|
|
|
# our nodes first (will be used by default) then an infura node
|
|
|
|
beacon_node_web3_urls: "{{ geth_ws_addresses + [ selected_infura_url ] }}"
|