diff --git a/ansible/mainnet.yml b/ansible/mainnet.yml index 1dbc87e..4e93d34 100644 --- a/ansible/mainnet.yml +++ b/ansible/mainnet.yml @@ -33,7 +33,7 @@ hosts: nimbus-mainnet-metal vars: # FIXME: Use all Geth nodes available in the fleet until we resync. - geth_node_api_fleet_name: 'nimbus.{{ beacon_node_network }}' + geth_node_api_fleet_names: ['nimbus.get', 'nimbus.{{ beacon_node_network }}'] roles: - { role: swap-file, tags: [ swap-file ] } - { role: open-ports, tags: [ open-ports ] } diff --git a/ansible/roles/get-geth-api-urls/README.md b/ansible/roles/get-geth-api-urls/README.md index 17fb2b4..662a112 100644 --- a/ansible/roles/get-geth-api-urls/README.md +++ b/ansible/roles/get-geth-api-urls/README.md @@ -6,7 +6,7 @@ This role assembles the list of Web3 Eth1 URLs used by Nimbus Beacon nodes to sy There are only two important configuration keys: ```yaml -geth_node_api_fleet_name: 'nimbus.geth' -geth_node_api_consul_names: ['my-geth-node-rpc'] +geth_node_api_fleet_names: ['nimbus.geth', 'nimbus.mainnet'] +geth_node_api_consul_name: 'my-geth-node-rpc' ``` The Geth node Consul service is expected to have an `url` in metadata. diff --git a/ansible/roles/get-geth-api-urls/defaults/main.yml b/ansible/roles/get-geth-api-urls/defaults/main.yml index 8db77cf..0037f99 100644 --- a/ansible/roles/get-geth-api-urls/defaults/main.yml +++ b/ansible/roles/get-geth-api-urls/defaults/main.yml @@ -6,8 +6,7 @@ eth2_to_eth1_map: eth2_network_name: '{{ beacon_node_network | mandatory }}' eth1_network_name: '{{ eth2_to_eth1_map[eth2_network_name] | mandatory }}' -geth_node_api_fleet_name: 'nimbus.geth' -geth_node_api_consul_names: - - 'geth-{{ eth1_network_name | mandatory }}' +geth_node_api_consul_name: 'geth-{{ eth1_network_name | mandatory }}' +geth_node_api_fleet_names: ['nimbus.geth'] consul_catalog_url: 'http://localhost:8500/v1/catalog' diff --git a/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml b/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml index dbbac79..09273aa 100644 --- a/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml +++ b/ansible/roles/get-geth-api-urls/tasks/consul/posix.yml @@ -6,7 +6,7 @@ - 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 }}' + 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 diff --git a/ansible/roles/get-geth-api-urls/tasks/consul/windows.yml b/ansible/roles/get-geth-api-urls/tasks/consul/windows.yml index aca5efe..b53ebda 100644 --- a/ansible/roles/get-geth-api-urls/tasks/consul/windows.yml +++ b/ansible/roles/get-geth-api-urls/tasks/consul/windows.yml @@ -8,7 +8,7 @@ - name: Find available Geth API Auth RPC services win_uri: - url: '{{ consul_catalog_url }}/service/{{ service_name }}-authrpc?dc={{ item }}&tag={{ geth_node_api_fleet_name }}' + 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 }}' diff --git a/ansible/roles/get-geth-api-urls/tasks/main.yml b/ansible/roles/get-geth-api-urls/tasks/main.yml index 2780732..48b368f 100644 --- a/ansible/roles/get-geth-api-urls/tasks/main.yml +++ b/ansible/roles/get-geth-api-urls/tasks/main.yml @@ -1,12 +1,12 @@ --- - include_tasks: consul/posix.yml when: ansible_system in ['Linux', 'Darwin'] - loop: '{{ geth_node_api_consul_names }}' + loop: '{{ geth_node_api_fleet_names }}' loop_control: - loop_var: 'service_name' + loop_var: 'fleet_name' - include_tasks: consul/windows.yml when: ansible_system == 'Win32NT' - loop: '{{ geth_node_api_consul_names }}' + loop: '{{ geth_node_api_fleet_names }}' loop_control: - loop_var: 'service_name' + loop_var: 'fleet_name'