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

26 lines
829 B
YAML

---
- name: Find available data centers
win_uri:
url: '{{ consul_catalog_url }}/datacenters'
content_type: 'application/json'
return_content: true
register: data_centers
- name: Find available Geth API Auth RPC services
win_uri:
url: '{{ consul_catalog_url }}/service/{{ geth_node_api_consul_name }}-authrpc?dc={{ item }}&tag={{ fleet_name }}'
content_type: 'application/json'
return_content: true
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
| selectattr("json", "defined")
| sum(attribute="json", start=[])
| map(attribute="ServiceMeta.url")
| list }}