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 }})'