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

22 lines
664 B
YAML

---
- include_tasks: consul/posix.yml
when: ansible_system in ['Linux', 'Darwin']
- include_tasks: consul/windows.yml
when: ansible_system == 'Win32NT'
# On Windows json attribute is missing when it's [].
- name: Extract Geth websocket IP and port
set_fact:
geth_api_addresses: |
{{ geth_ws_services.results
| selectattr("json", "defined")
| sum(attribute="json", start=[])
| map(attribute='ServiceMeta.url')
| list }}
- name: Extract Goerli Geth WebSocket URL
set_fact:
# our nodes first (will be used by default) then an infura node
beacon_node_web3_urls: "{{ geth_api_addresses + [ selected_infura_url ] }}"