From 931c9f38b74742b72c2d6e7c9227f490f4588662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 8 May 2024 10:20:06 +0200 Subject: [PATCH] nimbus.mainnet: dynamically derive public API node ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: https://github.com/status-im/nimbus-eth2/issues/6271 Signed-off-by: Jakub SokoĊ‚owski --- .../linux-01.ih-eu-mda1.nimbus.mainnet.yml | 15 ++++++++++++--- .../linux-02.ih-eu-mda1.nimbus.mainnet.yml | 13 +++++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ansible/host_vars/linux-01.ih-eu-mda1.nimbus.mainnet.yml b/ansible/host_vars/linux-01.ih-eu-mda1.nimbus.mainnet.yml index 16b1e04..d78ea07 100644 --- a/ansible/host_vars/linux-01.ih-eu-mda1.nimbus.mainnet.yml +++ b/ansible/host_vars/linux-01.ih-eu-mda1.nimbus.mainnet.yml @@ -2,7 +2,16 @@ # Communityu test REST API endpoint. beacon_node_rest_address: '0.0.0.0' -# WARNING: This will change if number of nodes changes. +# Extract dynamically port form layout. +test_api_beacon_node_branch: 'unstable' +test_api_beacon_node_rest_index: |- + {{ nodes_layout[hostname] + | ansible.utils.index_of(test='eq', key='branch', value=test_api_beacon_node_branch) + | first }} +test_api_beacon_node_rest_port: |- + {{ beacon_node_rest_port_base + test_api_beacon_node_rest_index|int }} + redirect_ports: - # beacon-node-mainnet-unstable-01 - - { src: 80, dst: 9302, comment: 'Test Beacon API unstable-01 (80->9302/tcp)' } + - src: 80 + dst: '{{ test_api_beacon_node_rest_port }}' + comment: 'Public Beacon API ({{ test_api_beacon_node_branch }})' diff --git a/ansible/host_vars/linux-02.ih-eu-mda1.nimbus.mainnet.yml b/ansible/host_vars/linux-02.ih-eu-mda1.nimbus.mainnet.yml index 44c103f..7d21ff4 100644 --- a/ansible/host_vars/linux-02.ih-eu-mda1.nimbus.mainnet.yml +++ b/ansible/host_vars/linux-02.ih-eu-mda1.nimbus.mainnet.yml @@ -2,7 +2,16 @@ # Communityu test REST API endpoint. beacon_node_rest_address: '0.0.0.0' +# Extract dynamically port form layout. +test_api_beacon_node_branch: 'testing' +test_api_beacon_node_rest_index: |- + {{ nodes_layout[hostname] + | ansible.utils.index_of(test='eq', key='branch', value=test_api_beacon_node_branch) }} +test_api_beacon_node_rest_port: |- + {{ beacon_node_rest_port_base + test_api_beacon_node_rest_index|int }} + # WARNING: This will change if number of nodes changes. redirect_ports: - # beacon-node-mainnet-testing-01 - - { src: 80, dst: 9301, comment: 'Test Beacon API testing-01 (80->9301/tcp)' } + - src: 80 + dst: '{{ test_api_beacon_node_rest_port }}' + comment: 'Public Beacon API ({{ test_api_beacon_node_branch }})'