Skip to content

Commit

Permalink
PROJECT-MGMT-4115: add support for cicd with RHEL9
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Bastide <[email protected]>
  • Loading branch information
prb112 committed Apr 16, 2024
1 parent 3597583 commit 1151021
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion modules/5_worker/worker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,17 @@ EOFX
mkdir -p /var/www/vhosts/1
systemctl restart httpd
for IFACE in $(nmcli device show 2>&1| grep GENERAL.DEVICE | grep -v env2 | grep -v lo | awk '{print $NF}')
os_ver=$(cat /etc/os-release | egrep "^VERSION_ID=" | awk -F'"' '{print $2}')
if [[ $os_ver != "9"* ]]
then
# RHEL8
IFACES=$(nmcli device show 2>&1| grep GENERAL.DEVICE | grep -v env2 | grep -v lo | awk '{print $NF}')
else
# RHEL9
IFACES=$(nmcli device show 2>&1| grep GENERAL.DEVICE | grep -v eth1 | grep -v lo | awk '{print $NF}')
fi
for IFACE in $(echo ${IFACES})
do
IP_ADDR="$(nmcli device show $${IFACE} 2>&1 | grep IP4.ADDRESS | sed 's|/24||g' | awk '{print $NF}')"
if [ -n "$${IP_ADDR}" ]
Expand Down

0 comments on commit 1151021

Please sign in to comment.