Skip to content

Commit

Permalink
add rule for mgmt network
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoveas committed Jan 10, 2025
1 parent 6447629 commit 38837b9
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ workflow:
- chain: baremetal-lab-post
env:
DISCONNECTED: "true"
PLATFORM: "baremetal"
documentation: |-
The baremetal-lab-ipi-install-disconnected workflow provides pre- and post- steps that provision and
deprovision an IPI OpenShift cluster with a disconnected configuration on a Baremetal lab,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,18 @@ timeout -s 9 10m ssh "${SSHOPTS[@]}" "root@${AUX_HOST}" bash -s -- \
for ip in $IP_ARRAY; do
iptables -D FORWARD -s ${ip} ! -d "${INTERNAL_NET_CIDR}" -j DROP
done
EOF
EOF

if [ x"${DISCONNECTED}" == x"true" ] && [ "${PLATFORM}" == "baremetal" ]; then
timeout -s 9 10m ssh "${SSHOPTS[@]}" "root@${AUX_HOST}" bash -s -- \
"${INTERNAL_NET_CIDR}" "${IP_ARRAY[@]}" << 'EOF'
set -o nounset
set -o errexit
INTERNAL_NET_CIDR="${1}"
IP_ARRAY="${@:2}"
for ip in $IP_ARRAY; do
# TODO: change to firewalld or nftables
iptables -D FORWARD -s ${ip} -d 192.168.70.0/24 -j ACCEPT
done
EOF
fi
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ref:
default: ""
- name: DISCONNECTED
default: "false"
- name: PLATFORM
default: "none"
- name: INTERNAL_NET_CIDR
default: "192.168.80.0/22"
documentation: |-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ for bmhost in $(yq e -o=j -I=0 '.[]' "${SHARED_DIR}/hosts.yaml"); do
IP_ARRAY+=( "$ip" )
done

if [ x"${DISCONNECTED}" == x"true" ] && [ "${PLATFORM}" == "baremetal" ]; then
timeout -s 9 10m ssh "${SSHOPTS[@]}" "root@${AUX_HOST}" bash -s -- \
"${INTERNAL_NET_CIDR}" "${IP_ARRAY[@]}" << 'EOF'
set -o nounset
set -o errexit
INTERNAL_NET_CIDR="${1}"
IP_ARRAY="${@:2}"
for ip in $IP_ARRAY; do
# TODO: change to firewalld or nftables
iptables -A FORWARD -s ${ip} -d 192.168.70.0/24 -j ACCEPT
done
EOF
fi

timeout -s 9 10m ssh "${SSHOPTS[@]}" "root@${AUX_HOST}" bash -s -- \
"${INTERNAL_NET_CIDR}" "${IP_ARRAY[@]}" << 'EOF'
set -o nounset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ ref:
default: ""
- name: DISCONNECTED
default: "false"
- name: PLATFORM
default: "none"
- name: INTERNAL_NET_CIDR
default: "192.168.80.0/22"
- name: CLUSTER_WIDE_PROXY
Expand Down

0 comments on commit 38837b9

Please sign in to comment.