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

23 lines
704 B
YAML
Raw Normal View History

---
- 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_rpc_services.results
+ 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_all: "{{ geth_api_addresses + [ selected_infura_url ] }}"