Skip to content

Commit 8280a62

Browse files
committed
add conditional check to see if node has v6 address
1 parent 575ba40 commit 8280a62

File tree

11 files changed

+33
-33
lines changed

11 files changed

+33
-33
lines changed

roles/besu/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ besu_user: besu
22
besu_datadir: /data/besu
33
besu_auth_jwt_path: /data/execution-auth.secret
44
besu_announced_ip: "{{ ansible_host }}"
5-
besu_announced_ipv6: "{{ ansible_default_ipv6.get('address', '') if besu_ipv6_enabled else '' }}"
5+
besu_announced_ipv6: "{{ ansible_default_ipv6.address if besu_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
66

77
besu_cleanup: false # when set to "true" it will remove the container
88

@@ -27,7 +27,7 @@ besu_container_ports_ipv6:
2727
- "[::]:{{ besu_ports_p2p }}:{{ besu_ports_p2p }}/udp"
2828

2929
besu_container_ports: >-
30-
{{ besu_container_ports_ipv4 + besu_container_ports_ipv6 if besu_ipv6_enabled else [] }}
30+
{{ besu_container_ports_ipv4 + (besu_container_ports_ipv6 if besu_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
3131
3232
besu_container_volumes:
3333
- "{{ besu_datadir }}:/data"
@@ -56,7 +56,7 @@ besu_container_command_v6:
5656
- --p2p-host-ipv6={{ besu_announced_ipv6 }}
5757

5858
besu_container_command: >-
59-
{{ besu_container_command_default + besu_container_command_v6 if besu_ipv6_enabled else [] }}
59+
{{ besu_container_command_default + (besu_container_command_v6 if besu_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
6060
6161
besu_container_command_extra_args: []
6262

roles/erigon/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ erigon_user: erigon
22
erigon_datadir: /data/erigon
33
erigon_auth_jwt_path: /data/execution-auth.secret
44
erigon_announced_ip: "{{ ansible_host }}"
5-
erigon_announced_ipv6: "{{ ansible_default_ipv6.address if erigon_ipv6_enabled else '' }}"
5+
erigon_announced_ipv6: "{{ ansible_default_ipv6.address if erigon_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
66

77
erigon_cleanup: false # when set to "true" it will remove the container
88

@@ -27,7 +27,7 @@ erigon_container_ports_ipv6:
2727
- "[::]:{{ erigon_ports_p2p }}:{{ erigon_ports_p2p }}/udp"
2828

2929
erigon_container_ports: >-
30-
{{ erigon_container_ports_ipv4 + erigon_container_ports_ipv6 if erigon_ipv6_enabled else [] }}
30+
{{ erigon_container_ports_ipv4 + (erigon_container_ports_ipv6 if erigon_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
3131
3232
erigon_container_volumes:
3333
- "{{ erigon_datadir }}:/data"
@@ -56,7 +56,7 @@ erigon_container_command_v6:
5656
- --nat=extip:{{ erigon_announced_ipv6 }}
5757

5858
erigon_container_command: >-
59-
{{ erigon_container_command_default + erigon_container_command_v6 if erigon_ipv6_enabled else [] }}
59+
{{ erigon_container_command_default + (erigon_container_command_v6 if erigon_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
6060
6161
erigon_container_command_extra_args: []
6262
# - --prune=htc

roles/ethereumjs/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ethereumjs_user: ethereumjs
22
ethereumjs_datadir: /data/ethereumjs
33
ethereumjs_auth_jwt_path: /data/execution-auth.secret
44
ethereumjs_announced_ip: "{{ ansible_host }}"
5-
ethereumjs_announced_ipv6: "{{ ansible_default_ipv6.address if ethereumjs_ipv6_enabled else '' }}"
5+
ethereumjs_announced_ipv6: "{{ ansible_default_ipv6.address if ethereumjs_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
66

77
ethereumjs_cleanup: false # when set to "true" it will remove the container
88

@@ -26,7 +26,7 @@ ethereumjs_container_ports_ipv6:
2626
- "[::]:{{ ethereumjs_ports_p2p }}:{{ ethereumjs_ports_p2p }}/udp"
2727

2828
ethereumjs_container_ports: >-
29-
{{ ethereumjs_container_ports_ipv4 + ethereumjs_container_ports_ipv6 if ethereumjs_ipv6_enabled else [] }}
29+
{{ ethereumjs_container_ports_ipv4 + (ethereumjs_container_ports_ipv6 if ethereumjs_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
3030
3131
ethereumjs_container_volumes:
3232
- "{{ ethereumjs_datadir }}:/data"
@@ -51,7 +51,7 @@ ethereumjs_container_command_v6: []
5151
# - --extIP={{ ethereumjs_announced_ipv6 }} # not supported
5252

5353
ethereumjs_container_command: >-
54-
{{ ethereumjs_container_command_default + ethereumjs_container_command_v6 if ethereumjs_ipv6_enabled else [] }}
54+
{{ ethereumjs_container_command_default + (ethereumjs_container_command_v6 if ethereumjs_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
5555
5656
ethereumjs_container_command_extra_args: []
5757

roles/geth/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ geth_user: geth
22
geth_datadir: /data/geth
33
geth_auth_jwt_path: /data/execution-auth.secret
44
geth_announced_ip: "{{ ansible_host }}"
5-
geth_announced_ipv6: "{{ ansible_default_ipv6.address if geth_ipv6_enabled else '' }}"
5+
geth_announced_ipv6: "{{ ansible_default_ipv6.address if geth_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
66

77
geth_cleanup: false # when set to "true" it will remove the container
88

@@ -27,7 +27,7 @@ geth_container_ports_ipv6:
2727
- "[::]:{{ geth_ports_p2p }}:{{ geth_ports_p2p }}/udp"
2828

2929
geth_container_ports: >-
30-
{{ geth_container_ports_ipv4 + geth_container_ports_ipv6 if geth_ipv6_enabled else [] }}
30+
{{ geth_container_ports_ipv4 + (geth_container_ports_ipv6 if geth_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
3131
3232
geth_container_volumes:
3333
- "{{ geth_datadir }}:/data"
@@ -55,7 +55,7 @@ geth_container_command_v6:
5555
- --nat=extip:{{ geth_announced_ipv6 }}
5656

5757
geth_container_command: >-
58-
{{ geth_container_command_default + geth_container_command_v6 if geth_ipv6_enabled else [] }}
58+
{{ geth_container_command_default + (geth_container_command_v6 if geth_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
5959
6060
geth_container_command_extra_args: []
6161
# - --http.api=eth,net,web3

roles/lighthouse/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ lighthouse_beacon_endpoint: "http://{{ lighthouse_container_name }}:{{ lighthous
66
lighthouse_mev_boost_endpoint: "http://mev-boost:18550"
77

88
lighthouse_announced_ip: "{{ ansible_host }}"
9-
lighthouse_announced_ipv6: "{{ ansible_default_ipv6.address if lighthouse_ipv6_enabled else '' }}"
9+
lighthouse_announced_ipv6: "{{ ansible_default_ipv6.address if lighthouse_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
1010

1111
lighthouse_cleanup: false # when set to "true" it will remove the container(s)
1212

@@ -44,7 +44,7 @@ lighthouse_container_ports_ipv6:
4444
- "[::]:{{ lighthouse_ports_quic }}:{{ lighthouse_ports_quic }}/udp"
4545

4646
lighthouse_container_ports: >-
47-
{{ lighthouse_container_ports_ipv4 + lighthouse_container_ports_ipv6 if lighthouse_ipv6_enabled else [] }}
47+
{{ lighthouse_container_ports_ipv4 + (lighthouse_container_ports_ipv6 if lighthouse_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
4848
4949
lighthouse_container_volumes:
5050
- "{{ lighthouse_datadir }}:/data"
@@ -86,7 +86,7 @@ lighthouse_container_command_v6:
8686
- --enr-quic6-port={{ lighthouse_ports_quic }}
8787

8888
lighthouse_container_command: >-
89-
{{ lighthouse_container_command_default + lighthouse_container_command_v6 if lighthouse_ipv6_enabled else [] }}
89+
{{ lighthouse_container_command_default + (lighthouse_container_command_v6 if lighthouse_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
9090
9191
lighthouse_container_command_extra_args: []
9292

roles/lodestar/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ lodestar_beacon_endpoint: "http://{{ lodestar_container_name }}:{{ lodestar_port
66
lodestar_mev_boost_endpoint: "http://mev-boost:18550"
77

88
lodestar_announced_ip: "{{ ansible_host }}"
9-
lodestar_announced_ipv6: "{{ ansible_default_ipv6.address if lodestar_ipv6_enabled else '' }}"
9+
lodestar_announced_ipv6: "{{ ansible_default_ipv6.address if lodestar_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
1010

1111
lodestar_cleanup: false # when set to "true" it will remove the container(s)
1212

@@ -41,7 +41,7 @@ lodestar_container_ports_ipv6:
4141
- "[::]:{{ lodestar_ports_p2p_udp_ipv6 }}:{{ lodestar_ports_p2p_udp_ipv6 }}/udp"
4242

4343
lodestar_container_ports: >-
44-
{{ lodestar_container_ports_ipv4 + lodestar_container_ports_ipv6 if lodestar_ipv6_enabled else [] }}
44+
{{ lodestar_container_ports_ipv4 + (lodestar_container_ports_ipv6 if lodestar_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
4545
4646
lodestar_container_volumes:
4747
- "{{ lodestar_datadir }}:/data"
@@ -76,7 +76,7 @@ lodestar_container_command_v6:
7676
- --enr.udp6={{ lodestar_ports_p2p_udp_ipv6 }}
7777

7878
lodestar_container_command: >-
79-
{{ lodestar_container_command_default + lodestar_container_command_v6 if lodestar_ipv6_enabled else [] }}
79+
{{ lodestar_container_command_default + (lodestar_container_command_v6 if lodestar_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
8080
8181
lodestar_container_command_extra_args: []
8282

roles/nethermind/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ nethermind_user: nethermind
22
nethermind_datadir: /data/nethermind
33
nethermind_auth_jwt_path: /data/execution-auth.secret
44
nethermind_announced_ip: "{{ ansible_host }}"
5-
nethermind_announced_ipv6: "{{ ansible_default_ipv6.address if nethermind_ipv6_enabled else '' }}"
5+
nethermind_announced_ipv6: "{{ ansible_default_ipv6.address if nethermind_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
66

77
nethermind_cleanup: false # when set to "true" it will remove the container
88

@@ -27,7 +27,7 @@ nethermind_container_ports_ipv6:
2727
- "[::]:{{ nethermind_ports_p2p }}:{{ nethermind_ports_p2p }}/udp"
2828

2929
nethermind_container_ports: >-
30-
{{ nethermind_container_ports_ipv4 + nethermind_container_ports_ipv6 if nethermind_ipv6_enabled else [] }}
30+
{{ nethermind_container_ports_ipv4 + (nethermind_container_ports_ipv6 if nethermind_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
3131
3232
nethermind_container_volumes:
3333
- "{{ nethermind_datadir }}:/data"
@@ -60,7 +60,7 @@ nethermind_container_command_v6: []
6060
# - --Network.ExternalIp={{ nethermind_announced_ipv6 }} # not yet supported https://github.com/NethermindEth/nethermind/issues/6822#issuecomment-1993851323
6161

6262
nethermind_container_command: >-
63-
{{ nethermind_container_command_default + nethermind_container_command_v6 if nethermind_ipv6_enabled else [] }}
63+
{{ nethermind_container_command_default + (nethermind_container_command_v6 if nethermind_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
6464
6565
nethermind_container_command_extra_args: []
6666

roles/nimbus/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ nimbus_datadir: /data/nimbus
33
nimbus_auth_jwt_path: /data/execution-auth.secret
44
nimbus_execution_engine_endpoint: http://geth:8551
55
nimbus_announced_ip: "{{ ansible_host }}"
6-
nimbus_announced_ipv6: "{{ ansible_default_ipv6.address if nimbus_ipv6_enabled else '' }}"
6+
nimbus_announced_ipv6: "{{ ansible_default_ipv6.address if nimbus_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
77
nimbus_mev_boost_endpoint: "http://mev-boost:18550"
88

99
nimbus_cleanup: false # when set to "true" it will remove the container
@@ -53,7 +53,7 @@ nimbus_container_ports_ipv6:
5353
- "[::]:{{ nimbus_ports_p2p_udp }}:{{ nimbus_ports_p2p_udp }}/udp"
5454

5555
nimbus_container_ports: >-
56-
{{ nimbus_container_ports_ipv4 + nimbus_container_ports_ipv6 if nimbus_ipv6_enabled else [] }}
56+
{{ nimbus_container_ports_ipv4 + (nimbus_container_ports_ipv6 if nimbus_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
5757
5858
nimbus_container_volumes:
5959
- "{{ nimbus_datadir }}:/data"
@@ -84,7 +84,7 @@ nimbus_container_command_v6: []
8484
# - --nat=extip:{{ nimbus_announced_ipv6 }} # not supported yet
8585

8686
nimbus_container_command: >-
87-
{{ nimbus_container_command_default + nimbus_container_command_v6 if nimbus_ipv6_enabled else [] }}
87+
{{ nimbus_container_command_default + (nimbus_container_command_v6 if nimbus_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
8888
8989
nimbus_container_command_extra_args: []
9090
# - --graffiti=hello-world

roles/prysm/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ prysm_auth_jwt_path: /data/execution-auth.secret
44
prysm_execution_engine_endpoint: http://geth:8551
55
prysm_beacon_endpoint: "{{ prysm_container_name }}:{{ prysm_ports_grpc }}"
66
prysm_announced_ip: "{{ ansible_host }}"
7-
prysm_announced_ipv6: "{{ ansible_default_ipv6.address if prysm_ipv6_enabled else '' }}"
7+
prysm_announced_ipv6: "{{ ansible_default_ipv6.address if prysm_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
88
prysm_mev_boost_endpoint: "http://mev-boost:18550"
99

1010
prysm_cleanup: false # when set to "true" it will remove the container(s)
@@ -39,7 +39,7 @@ prysm_container_ports_ipv6:
3939
- "[::]:{{ prysm_ports_p2p_udp }}:{{ prysm_ports_p2p_udp }}/udp"
4040

4141
prysm_container_ports: >-
42-
{{ prysm_container_ports_ipv4 + prysm_container_ports_ipv6 if prysm_ipv6_enabled else [] }}
42+
{{ prysm_container_ports_ipv4 + (prysm_container_ports_ipv6 if prysm_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
4343
4444
prysm_container_volumes:
4545
- "{{ prysm_datadir }}:/data"
@@ -68,7 +68,7 @@ prysm_container_command_v6: []
6868
# - --p2p-host-ipv6={{ prysm_announced_ipv6 }} # not supported yet
6969

7070
prysm_container_command: >-
71-
{{ prysm_container_command_default + prysm_container_command_v6 if prysm_ipv6_enabled else [] }}
71+
{{ prysm_container_command_default + (prysm_container_command_v6 if prysm_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
7272
7373
prysm_container_command_extra_args: []
7474

roles/reth/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ reth_user: reth
22
reth_datadir: /data/reth
33
reth_auth_jwt_path: /data/execution-auth.secret
44
reth_announced_ip: "{{ ansible_host }}"
5-
reth_announced_ipv6: "{{ ansible_default_ipv6.address if reth_ipv6_enabled else '' }}"
5+
reth_announced_ipv6: "{{ ansible_default_ipv6.address if reth_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
66

77
reth_cleanup: false # when set to "true" it will remove the container
88

@@ -27,7 +27,7 @@ reth_container_ports_ipv6:
2727
- "[::]:{{ reth_ports_p2p }}:{{ reth_ports_p2p }}/udp"
2828

2929
reth_container_ports: >-
30-
{{ reth_container_ports_ipv4 + reth_container_ports_ipv6 if ret_ipv6_enabled else [] }}
30+
{{ reth_container_ports_ipv4 + (reth_container_ports_ipv6 if ret_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
3131
3232
reth_container_volumes:
3333
- "{{ reth_datadir }}:/data"
@@ -53,7 +53,7 @@ reth_container_command_v6: []
5353
# - --nat=extip:{{ reth_announced_ipv6 }} # not supported
5454

5555
reth_container_command: >-
56-
{{ reth_container_command_default + reth_container_command_v6 if ret_ipv6_enabled else [] }}
56+
{{ reth_container_command_default + (reth_container_command_v6 if ret_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
5757
5858
reth_container_command_extra_args: []
5959
# - --http.api=eth,net,web3

roles/teku/defaults/main.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ teku_datadir: /data/teku
33
teku_auth_jwt_path: /data/execution-auth.secret
44
teku_execution_engine_endpoint: http://geth:8551
55
teku_announced_ip: "{{ ansible_host }}"
6-
teku_announced_ipv6: "{{ ansible_default_ipv6.address if teku_ipv6_enabled else '' }}"
6+
teku_announced_ipv6: "{{ ansible_default_ipv6.address if teku_ipv6_enabled and ansible_default_ipv6.address is defined else '' }}"
77
teku_mev_boost_endpoint: "http://mev-boost:18550"
88

99
teku_cleanup: false # when set to "true" it will remove the container
@@ -37,7 +37,7 @@ teku_container_ports_ipv6:
3737
- "[::]:{{ teku_ports_p2p_udp }}:{{ teku_ports_p2p_udp }}/udp"
3838

3939
teku_container_ports: >-
40-
{{ teku_container_ports_ipv4 + teku_container_ports_ipv6 if teku_ipv6_enabled else [] }}
40+
{{ teku_container_ports_ipv4 + (teku_container_ports_ipv6 if teku_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
4141
4242
teku_container_volumes:
4343
- "{{ teku_datadir }}:/data"
@@ -68,7 +68,7 @@ teku_container_command_v6: []
6868
# - --p2p-advertised-ipv6={{ teku_announced_ipv6 }} # not supported yet
6969

7070
teku_container_command: >-
71-
{{ teku_container_command_default + teku_container_command_v6 if teku_ipv6_enabled else [] }}
71+
{{ teku_container_command_default + (teku_container_command_v6 if teku_ipv6_enabled and ansible_default_ipv6.address is defined else []) }}
7272
7373
teku_container_command_extra_args:
7474
- --data-storage-mode=PRUNE

0 commit comments

Comments
 (0)