|
149 | 149 | {{ oc_header }} |
150 | 150 | {{ ovn_copy_shell_vars }} |
151 | 151 |
|
152 | | - $CONTROLLER1_SSH if sudo systemctl is-active tripleo_ovn_cluster_northd.service ';' then sudo systemctl stop tripleo_ovn_cluster_northd.service ';' fi |
153 | | - $CONTROLLER2_SSH if sudo systemctl is-active tripleo_ovn_cluster_northd.service ';' then sudo systemctl stop tripleo_ovn_cluster_northd.service ';' fi |
154 | | - $CONTROLLER3_SSH if sudo systemctl is-active tripleo_ovn_cluster_northd.service ';' then sudo systemctl stop tripleo_ovn_cluster_northd.service ';' fi |
| 152 | + for i in {1..3}; do |
| 153 | + SSH_CMD=CONTROLLER${i}_SSH |
| 154 | + if [ ! -z "${!SSH_CMD}" ]; then |
| 155 | + ${!SSH_CMD} if sudo systemctl is-active tripleo_ovn_cluster_northd.service ';' then sudo systemctl stop tripleo_ovn_cluster_northd.service ';' fi |
| 156 | + fi |
| 157 | + done |
155 | 158 |
|
156 | 159 | # If ovn_adoption is done using scenario A (different networks between podified |
157 | 160 | # and tripleo deployments) in order to be able to dump OVN database a nftable |
|
164 | 167 | {{ oc_header }} |
165 | 168 | {{ ovn_copy_shell_vars }} |
166 | 169 |
|
167 | | - $CONTROLLER1_SSH sudo nft add rule inet filter INPUT ip saddr {{ internalapi_src }} tcp dport 6641 ct state new counter accept |
168 | | - $CONTROLLER1_SSH sudo nft add rule inet filter INPUT ip saddr {{ internalapi_src }} tcp dport 6642 ct state new counter accept |
169 | | - $CONTROLLER2_SSH sudo nft add rule inet filter INPUT ip saddr {{ internalapi_src }} tcp dport 6641 ct state new counter accept |
170 | | - $CONTROLLER2_SSH sudo nft add rule inet filter INPUT ip saddr {{ internalapi_src }} tcp dport 6642 ct state new counter accept |
171 | | - $CONTROLLER3_SSH sudo nft add rule inet filter INPUT ip saddr {{ internalapi_src }} tcp dport 6641 ct state new counter accept |
172 | | - $CONTROLLER3_SSH sudo nft add rule inet filter INPUT ip saddr {{ internalapi_src }} tcp dport 6642 ct state new counter accept |
| 170 | + for i in {1..3}; do |
| 171 | + SSH_CMD=CONTROLLER${i}_SSH |
| 172 | + if [ ! -z "${!SSH_CMD}" ]; then |
| 173 | + ${!SSH_CMD} sudo nft add rule inet filter INPUT ip saddr {{ internalapi_src }} tcp dport 6641 ct state new counter accept |
| 174 | + ${!SSH_CMD} sudo nft add rule inet filter INPUT ip saddr {{ internalapi_src }} tcp dport 6642 ct state new counter accept |
| 175 | + fi |
| 176 | + done |
173 | 177 | when: not ipv6_enabled | bool |
174 | 178 |
|
175 | 179 | - name: Add nftables rule to allow podified internalapi traffic to controllers (IPv6) |
|
178 | 182 | {{ oc_header }} |
179 | 183 | {{ ovn_copy_shell_vars }} |
180 | 184 |
|
181 | | - $CONTROLLER1_SSH sudo nft add rule inet filter INPUT ip6 saddr {{ internalapi_src_ipv6 }} tcp dport 6641 ct state new counter accept |
182 | | - $CONTROLLER1_SSH sudo nft add rule inet filter INPUT ip6 saddr {{ internalapi_src_ipv6 }} tcp dport 6642 ct state new counter accept |
183 | | - $CONTROLLER2_SSH sudo nft add rule inet filter INPUT ip6 saddr {{ internalapi_src_ipv6 }} tcp dport 6641 ct state new counter accept |
184 | | - $CONTROLLER2_SSH sudo nft add rule inet filter INPUT ip6 saddr {{ internalapi_src_ipv6 }} tcp dport 6642 ct state new counter accept |
185 | | - $CONTROLLER3_SSH sudo nft add rule inet filter INPUT ip6 saddr {{ internalapi_src_ipv6 }} tcp dport 6641 ct state new counter accept |
186 | | - $CONTROLLER3_SSH sudo nft add rule inet filter INPUT ip6 saddr {{ internalapi_src_ipv6 }} tcp dport 6642 ct state new counter accept |
| 185 | + for i in {1..3}; do |
| 186 | + SSH_CMD=CONTROLLER${i}_SSH |
| 187 | + if [ ! -z "${!SSH_CMD}" ]; then |
| 188 | + ${!SSH_CMD} sudo nft add rule inet filter INPUT ip6 saddr {{ internalapi_src_ipv6 }} tcp dport 6641 ct state new counter accept |
| 189 | + ${!SSH_CMD} sudo nft add rule inet filter INPUT ip6 saddr {{ internalapi_src_ipv6 }} tcp dport 6642 ct state new counter accept |
| 190 | + fi |
| 191 | + done |
187 | 192 | when: ipv6_enabled | bool |
188 | 193 |
|
189 | 194 | - name: dump OVN databases using tcp connection |
|
307 | 312 | {{ shell_header }} |
308 | 313 | {{ oc_header }} |
309 | 314 | {{ ovn_copy_shell_vars }} |
310 | | -
|
311 | | - $CONTROLLER1_SSH if sudo systemctl is-active tripleo_ovn_cluster_north_db_server.service ';' then sudo systemctl stop tripleo_ovn_cluster_north_db_server.service ';' fi |
312 | | - $CONTROLLER2_SSH if sudo systemctl is-active tripleo_ovn_cluster_north_db_server.service ';' then sudo systemctl stop tripleo_ovn_cluster_north_db_server.service ';' fi |
313 | | - $CONTROLLER3_SSH if sudo systemctl is-active tripleo_ovn_cluster_north_db_server.service ';' then sudo systemctl stop tripleo_ovn_cluster_north_db_server.service ';' fi |
314 | | -
|
315 | | - $CONTROLLER1_SSH if sudo systemctl is-active tripleo_ovn_cluster_south_db_server.service ';' then sudo systemctl stop tripleo_ovn_cluster_south_db_server.service ';' fi |
316 | | - $CONTROLLER2_SSH if sudo systemctl is-active tripleo_ovn_cluster_south_db_server.service ';' then sudo systemctl stop tripleo_ovn_cluster_south_db_server.service ';' fi |
317 | | - $CONTROLLER3_SSH if sudo systemctl is-active tripleo_ovn_cluster_south_db_server.service ';' then sudo systemctl stop tripleo_ovn_cluster_south_db_server.service ';' fi |
| 315 | + for i in {1..3}; do |
| 316 | + SSH_CMD=CONTROLLER${i}_SSH |
| 317 | + if [ ! -z "${!SSH_CMD}" ]; then |
| 318 | + ${!SSH_CMD} if sudo systemctl is-active tripleo_ovn_cluster_north_db_server.service ';' then sudo systemctl stop tripleo_ovn_cluster_north_db_server.service ';' fi |
| 319 | + fi |
| 320 | + done |
| 321 | +
|
| 322 | + for i in {1..3}; do |
| 323 | + SSH_CMD=CONTROLLER${i}_SSH |
| 324 | + if [ ! -z "${!SSH_CMD}" ]; then |
| 325 | + ${!SSH_CMD} if sudo systemctl is-active tripleo_ovn_cluster_south_db_server.service ';' then sudo systemctl stop tripleo_ovn_cluster_south_db_server.service ';' fi |
| 326 | + fi |
| 327 | + done |
0 commit comments