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

21 lines
659 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/{{ geth_node_api_consul_name }}-authrpc?dc={{ item }}&tag={{ 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_exec_layer_urls_discovered_geth: |
{{ geth_rpc_services.results
| sum(attribute="json", start=[])
| map(attribute="ServiceMeta.url")
| list }}