infra-nimbus/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml

21 lines
642 B
YAML

---
- name: Find available data centers
uri:
url: '{{ consul_catalog_url }}/datacenters'
register: data_centers
- name: Find available Geth API Auth RPC services
uri:
url: '{{ consul_catalog_url }}/service/{{ service_name }}-authrpc?dc={{ item }}&tag={{ geth_node_api_fleet_name }}'
with_items: '{{ data_centers.json }}'
register: geth_rpc_services
# On Windows json attribute is missing when it's [].
- name: Extract Geth websocket IP and port
set_fact:
beacon_node_web3_urls_all: |
{{ geth_rpc_services.results
| sum(attribute="json", start=[])
| map(attribute="ServiceMeta.url")
| list }}