Skip to content

Commit

Permalink
idm_23.4.1_release (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
manjunathdhegde-2910 authored Oct 19, 2023
1 parent 707055d commit daaf05e
Show file tree
Hide file tree
Showing 232 changed files with 11,368 additions and 1,715 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,23 @@ create_helper()
print_status $? $LOGDIR/create_mgmt.log
check_running $OAANS oaa-mgmt

printf "\t\t\tCopying Settings file - "

kubectl exec -it -n $OAANS oaa-mgmt -- cp /u01/oracle/installsettings/installOAA.properties /u01/oracle/scripts/settings/ >> $LOGDIR/create_mgmt.log
print_status $? $LOGDIR/create_mgmt.log
fi

ET=$(date +%s)
print_time STEP "Create OAA Management container" $ST $ET >> $LOGDIR/timings.log
}

copy_settings_file()
{
print_msg "Copying Template OAA Propery file"
ST=$(date +%s)

kubectl exec -it -n $OAANS oaa-mgmt -- cp /u01/oracle/installsettings/installOAA.properties /u01/oracle/scripts/settings/ >> $LOGDIR/create_mgmt.log
print_status $? $LOGDIR/create_mgmt.log
ET=$(date +%s)
print_time STEP "Create OAA Management container" $ST $ET >> $LOGDIR/timings.log
}

# Copy file to Kubernetes Container
#
copy_to_oaa()
Expand Down Expand Up @@ -242,6 +249,23 @@ prepare_property_file()
sed -i "/sms:/{n;s/replicaCount.*/replicaCount: $OAA_SMS_REPLICAS/}" $override
sed -i "/oaa-policy:/{n;s/replicaCount.*/replicaCount: $OAA_POLICY_REPLICAS/}" $override
sed -i "/push:/{n;s/replicaCount.*/replicaCount: $OAA_PUSH_REPLICAS/}" $override
echo "resources:" >> $override
echo " requests:" >> $override
echo " cpu: $OAA_OAA_CPU" >> $override
echo " memory: \"$OAA_OAA_MEMORY\"" >> $override
sed -i "/spui:/a\ resources:\n requests:\n cpu: $OAA_SPUI_CPU\n memory: \"$OAA_SPUI_MEMORY\"" $override
sed -i "/totp:/a\ resources:\n requests:\n cpu: $OAA_TOTP_CPU\n memory: \"$OAA_TOTP_MEMORY\"" $override
sed -i "/yotp:/a\ resources:\n requests:\n cpu: $OAA_YOTP_CPU\n memory: \"$OAA_YOTP_MEMORY\"" $override
sed -i "/fido:/a\ resources:\n requests:\n cpu: $OAA_FIDO_CPU\n memory: \"$OAA_FIDO_MEMORY\"" $override
sed -i "/email:/a\ resources:\n requests:\n cpu: $OAA_EMAIL_CPU\n memory: \"$OAA_EMAIL_MEMORY\"" $override
sed -i "/push:/a\ resources:\n requests:\n cpu: $OAA_PUSH_CPU\n memory: \"$OAA_PUSH_MEMORY\"" $override
sed -i "/sms:/a\ resources:\n requests:\n cpu: $OAA_SMS_CPU\n memory: \"$OAA_SMS_MEMORY\"" $override
sed -i "/oaa-kba:/a\ resources:\n requests:\n cpu: $OAA_KBA_CPU\n memory: \"$OAA_KBA_MEMORY\"" $override
sed -i "/oaa-policy:/a\ resources:\n requests:\n cpu: $OAA_POLICY_CPU\n memory: \"$OAA_POLICY_MEMORY\"" $override
sed -i "/customfactor:/a\ resources:\n requests:\n cpu: $OAA_CUSTOM_CPU\n memory: \"$OAA_CUSTOM_MEMORY\"" $override
sed -i "/risk:/a\ resources:\n requests:\n cpu: $OAA_RISK_CPU\n memory: \"$OAA_RISK_MEMORY\"" $override
sed -i "/^riskcc:/a\ resources:\n requests:\n cpu: $OAA_RISKCC_CPU\n memory: \"$OAA_RISKCC_MEMORY\"" $override
sed -i "/oaa-admin-ui:/a\ resources:\n requests:\n cpu: $OAA_ADMIN_CPU\n memory: \"$OAA_ADMIN_MEMORY\"" $override


copy_to_oaa $propfile /u01/oracle/scripts/settings/installOAA.properties $OAANS oaa-mgmt >> $LOGDIR/create_property.log 2>&1
Expand All @@ -250,6 +274,7 @@ prepare_property_file()

ET=$(date +%s)
print_time STEP "Create property_file" $ST $ET >> $LOGDIR/timings.log

}


Expand Down Expand Up @@ -772,6 +797,33 @@ deploy_oaa()
print_time STEP "Deploy OAA" $ST $ET >> $LOGDIR/timings.log
}

# Deploy OAA on DR
#
deploy_oaa_dr()
{

print_msg "Deploy OAA"
ST=$(date +%s)

oaa_mgmt "/u01/oracle/OAA.sh -f installOAA.properties" > $LOGDIR/deploy_oaa.log 2>&1
if [ $? -gt 0 ]
then
grep -q "OAUTH validation failed" $LOGDIR/deploy_oaa.log
if [ $? = 0 ]

then
echo "Executing command /u01/oracle/scripts/validateOauthForOAA.sh -f /u01/oracle/scripts/settings/installOAA.properties -d true to get more information." >> $LOGDIR/deploy_oaa.log
oaa_mgmt "/u01/oracle/scripts/validateOauthForOAA.sh -f /u01/oracle/scripts/settings/installOAA.properties -d true" >> $LOGDIR/deploy_oaa.log 2>&1
fi
echo "Failed - See Logfile $LOGDIR/deploy_oaa.log"
exit 1
else
echo "Success."
fi

ET=$(date +%s)
print_time STEP "Deploy OAA" $ST $ET >> $LOGDIR/timings.log
}
# Deploy OAA Snapshot
#
import_snapshot()
Expand Down Expand Up @@ -1306,3 +1358,79 @@ create_test_user()
ET=$(date +%s)
print_time STEP "Create Test User $OAA_USER in LDAP" $ST $ET >> $LOGDIR/timings.log
}

# Modify the template to create a cronjob
#
create_dr_cronjob_files()
{
ST=$(date +%s)
print_msg "Creating Cron Job Files"

cp $TEMPLATE_DIR/dr_cron.yaml $WORKDIR/dr_cron.yaml
update_variable "<DRNS>" $DRNS $WORKDIR/dr_cron.yaml
update_variable "<DR_OAA_MINS>" $DR_OAA_MINS $WORKDIR/dr_cron.yaml
update_variable "<RSYNC_IMAGE>" $RSYNC_IMAGE $WORKDIR/dr_cron.yaml
update_variable "<RSYNC_VER>" $RSYNC_VER $WORKDIR/dr_cron.yaml

print_status $?

ET=$(date +%s)
print_time STEP "Create DR Cron Job Files" $ST $ET >> $LOGDIR/timings.log
}

# Create Persistent Volumes used by DR Job.
#
create_dr_pv()
{
ST=$(date +%s)
print_msg "Creating DR Persistent Volume"

kubectl create -f $WORKDIR/dr_dr_pv.yaml > $LOGDIR/create_dr_pv.log 2>&1
print_status $? $LOGDIR/create_dr_pv.log

ET=$(date +%s)
print_time STEP "Create DR Persistent Volume " $ST $ET >> $LOGDIR/timings.log
}

# Create Persistent Volume Claims used by DR Job.
#
create_dr_pvc()
{
ST=$(date +%s)
print_msg "Creating DR Persistent Volume Claim"
kubectl create -f $WORKDIR/dr_dr_pvc.yaml > $LOGDIR/create_dr_pvc.log 2>&1
print_status $? $LOGDIR/create_dr_pvc.log

ET=$(date +%s)
print_time STEP "Create DR Persistent Volume Claim " $ST $ET >> $LOGDIR/timings.log
}

# Delete the OAA files created by a fresh installation.
#
delete_oaa_files()
{
ST=$(date +%s)
print_msg "Delete OAA Files"

if [ -e $OAA_LOCAL_CONFIG_SHARE ] && [ ! "$OAA_LOCAL_CONFIG_SHARE" = "" ]
then
echo rm -rf $OAA_LOCAL_CONFIG_SHARE/helm $OAA_LOCAL_CONFIG_SHARE/installOAA.properties $OAA_LOCAL_CONFIG_SHARE/oaaoverride.yaml > $LOGDIR/delete_oaa.log 2>&1
rm -rf $OAA_LOCAL_CONFIG_SHARE/helm $OAA_LOCAL_CONFIG_SHARE/installOAA.properties $OAA_LOCAL_CONFIG_SHARE/oaaoverride.yaml >> $LOGDIR/delete_oaa.log 2>&1
else
echo "Share does not exist, or OAA_LOCAL_CONFIG_SHARE is not defined."
fi

if [ -e $OAA_LOCAL_VAULT_SHARE ] && [ ! "$OAA_LOCAL_VAULT_SHARE" = "" ]
then
echo rm -rf $OAA_LOCAL_VAULT_SHARE/.accessstore.pkcs12 > $LOGDIR/delete_oaa.log 2>&1
rm -rf $OAA_LOCAL_VAULT_SHARE/.accessstore.pkcs12 >> $LOGDIR/delete_oaa.log 2>&1
else
echo "Share does not exist, or OAA_LOCAL_VAULT_SHARE is not defined."
fi
print_status $? $LOGDIR/delete_oaa.log

ET=$(date +%s)
print_time STEP "Delete OAA Files" $ST $ET >> $LOGDIR/timings.log
}


Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ update_java_parameters()
printf "\t\t\tUpdating Java Parameters - "
cp $TEMPLATE_DIR/oamDomain.sedfile $WORKDIR
update_variable "<OAMSERVER_JAVA_PARAMS>" "$OAMSERVER_JAVA_PARAMS" $WORKDIR/oamDomain.sedfile
update_variable "<OAM_MEMORY>" "$OAM_MEMORY" $WORKDIR/oamDomain.sedfile
update_variable "<OAM_MAX_MEMORY>" "$OAM_MAX_MEMORY" $WORKDIR/oamDomain.sedfile
update_variable "<OAM_MAX_CPU>" "$OAM_MAX_CPU" $WORKDIR/oamDomain.sedfile
update_variable "<OAM_CPU>" "$OAM_CPU" $WORKDIR/oamDomain.sedfile
cd $WORKDIR/samples/create-access-domain/domain-home-on-pv

sed -i -f $WORKDIR/oamDomain.sedfile output/weblogic-domains/$OAM_DOMAIN_NAME/domain.yaml
Expand Down Expand Up @@ -733,21 +737,26 @@ create_oam_ohs_config()

if [ ! "$OHS_HOST1" = "" ]
then
if [ ! "$INGRESS_HOST" = "" ]
then
K8_WORKER_HOST1=$INGRESS_HOST
K8_WORKER_HOST2=$INGRESS_HOST
fi
cp $TEMPLATE_DIR/iadadmin_vh.conf $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
cp $TEMPLATE_DIR/login_vh.conf $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<OHS_HOST>" $OHS_HOST1 $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
update_variable "<OHS_PORT>" $OHS_PORT $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
update_variable "<OAM_ADMIN_LBR_HOST>" $OAM_ADMIN_LBR_HOST $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
update_variable "<OAM_ADMIN_LBR_PORT>" $OAM_ADMIN_LBR_PORT $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
update_variable "<K8_WORKER_HOST1>" ${INGRESS_HOST:=$K8_WORKER_HOST1} $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
update_variable "<K8_WORKER_HOST2>" ${INGRESS_HOST:=$K8_WORKER_HOST2} $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
update_variable "<K8_WORKER_HOST1>" $K8_WORKER_HOST1 $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
update_variable "<K8_WORKER_HOST2>" $K8_WORKER_HOST2 $OHS_PATH/$OHS_HOST1/iadadmin_vh.conf
update_variable "<OHS_HOST>" $OHS_HOST1 $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<OHS_PORT>" $OHS_PORT $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<OAM_LOGIN_LBR_PROTOCOL>" $OAM_LOGIN_LBR_PROTOCOL $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<OAM_LOGIN_LBR_HOST>" $OAM_LOGIN_LBR_HOST $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<OAM_LOGIN_LBR_PORT>" $OAM_LOGIN_LBR_PORT $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<K8_WORKER_HOST1>" ${INGRESS_HOST:=$K8_WORKER_HOST1} $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<K8_WORKER_HOST2>" ${INGRESS_HOST:=$K8_WORKER_HOST2} $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<K8_WORKER_HOST1>" $K8_WORKER_HOST1 $OHS_PATH/$OHS_HOST1/login_vh.conf
update_variable "<K8_WORKER_HOST2>" $K8_WORKER_HOST2 $OHS_PATH/$OHS_HOST1/login_vh.conf

if [ "$USE_INGRESS" = "true" ]
then
Expand All @@ -773,6 +782,7 @@ create_oam_ohs_config()

print_status $?


ET=`date +%s`
print_time STEP "Creating OHS config" $ST $ET >> $LOGDIR/timings.log
}
Expand Down Expand Up @@ -874,7 +884,7 @@ deploy_wls_monitor()

enable_monitor()
{
ST=`date +%s`
ST=$(date +%s)
print_msg "Configuring Prometheus Operator"

ENC_WEBLOGIC_USER=`encode_pwd $OAM_WEBLOGIC_USER`
Expand All @@ -894,7 +904,87 @@ enable_monitor()
kubectl apply -f $WORKDIR/samples/monitoring-service/manifests/ > $LOGDIR/enable_monitor.log
print_status $? $LOGDIR/enable_monitor.log

ET=`date +%s`
ET=$(date +%s)
print_time STEP "Configure Prometheus Operator" $ST $ET >> $LOGDIR/timings.log

}

create_dr_cronjob_files()
{
ST=$(date +%s)
print_msg "Creating Cron Job Files"

cp $TEMPLATE_DIR/dr_cron.yaml $WORKDIR/dr_cron.yaml
update_variable "<DRNS>" $DRNS $WORKDIR/dr_cron.yaml
update_variable "<DR_OAM_MINS>" $DR_OAM_MINS $WORKDIR/dr_cron.yaml
update_variable "<RSYNC_IMAGE>" $RSYNC_IMAGE $WORKDIR/dr_cron.yaml
update_variable "<RSYNC_VER>" $RSYNC_VER $WORKDIR/dr_cron.yaml
update_variable "<OAM_DOMAIN_NAME>" $OAM_DOMAIN_NAME $WORKDIR/dr_cron.yaml

print_status $?

ET=$(date +%s)
print_time STEP "Create DR Cron Job Files" $ST $ET >> $LOGDIR/timings.log
}


create_dr_pv()
{
ST=$(date +%s)
print_msg "Creating DR Persistent Volume"

kubectl create -f $WORKDIR/dr_dr_pv.yaml > $LOGDIR/create_dr_pv.log 2>&1
print_status $? $LOGDIR/create_dr_pv.log

ET=$(date +%s)
print_time STEP "Create DR Persistent Volume " $ST $ET >> $LOGDIR/timings.log
}

create_dr_pvc()
{
ST=$(date +%s)
print_msg "Creating DR Persistent Volume Claim"
kubectl create -f $WORKDIR/dr_dr_pvc.yaml > $LOGDIR/create_dr_pvc.log 2>&1
print_status $? $LOGDIR/create_dr_pvc.log

ET=$(date +%s)
print_time STEP "Create DR Persistent Volume Claim " $ST $ET >> $LOGDIR/timings.log
}


delete_oam_files()
{
ST=$(date +%s)
print_msg "Delete OAM Domain Files"

if [ -e $OAM_LOCAL_SHARE ] && [ ! "$OAM_LOCAL_SHARE" = "" ]
then
echo rm -rf $OAM_LOCAL_SHARE/domains $OAM_LOCAL_SHARE/applications $OAM_LOCAL_SHARE/stores $OAM_LOCAL_SHARE/keystores > $LOGDIR/delete_oam_domain.log 2>&1
rm -rf $OAM_LOCAL_SHARE/domains $OAM_LOCAL_SHARE/applications $OAM_LOCAL_SHARE/stores $OAM_LOCAL_SHARE/keystores >> $LOGDIR/delete_oam_domain.log 2>&1
else
echo "Share does not exist, or OAM_LOCAL_SHARE is not defined."
fi

print_status $? $LOGDIR/delete_oam_domain.log

ET=$(date +%s)
print_time STEP "Delete OAM Domain Files" $ST $ET >> $LOGDIR/timings.log
}

create_dr_source_pv()
{
ST=$(date +%s)
print_msg "Creating OAM Persistent Volume"

cp $TEMPLATE_DIR/dr_oampv.yaml $WORKDIR/dr_oampv.yaml
update_variable "<OAM_DOMAIN_NAME>" $OAM_DOMAIN_NAME $WORKDIR/dr_oampv.yaml
update_variable "<PVSERVER>" $DR_STANDBY_PVSERVER $WORKDIR/dr_oampv.yaml
update_variable "<OAM_SHARE>" $OAM_STANDBY_SHARE $WORKDIR/dr_oampv.yaml

kubectl create -f $WORKDIR/dr_oampv.yaml > $LOGDIR/dr_oampv.log 2>&1
print_status $? $LOGDIR/dr_oampv.log

ET=$(date +%s)
print_time STEP "Create OAM Persistent Volume" $ST $ET >> $LOGDIR/timings.log
}

Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,72 @@ copy_lbr_cert()
ET=$(date +%s)
print_time STEP "Copy $OAM_LOGIN_LBR_HOST Certificate to WebGate on $HOSTNAME" $ST $ET >> $LOGDIR/timings.log
}

update_ohs_route()
{
print_msg "Change OHS Routing"

ST=$(date +%s)

OLD_HOST1=$(grep WebLogicCluster $WORKDIR/*_vh.conf | sed "s/WebLogicCluster//" | tr -d ' ' | sed 's/,/:/' | cut -f2,4 -d: | tr ":" "\n" |sort | uniq | head -1 )
OLD_HOST2=$(grep WebLogicCluster $WORKDIR/*_vh.conf | sed "s/WebLogicCluster//" | tr -d ' ' | sed 's/,/:/' | cut -f2,4 -d: | tr ":" "\n" |sort | uniq | tail -1 )
NEW_HOST1=$(kubectl get nodes | cut -f1 -d " " | sed "/NAME/d" | head -1)
NEW_HOST2=$(kubectl get nodes | cut -f1 -d " " | sed "/NAME/d" | tail -1)

printf "\n\t\t\tChanging $OLD_HOST1 to $NEW_HOST1 - "
sed -i "s/$OLD_HOST1/$NEW_HOST1/g" $WORKDIR/*_vh.conf > $LOGDIR/update_ohs_route.log 2>&1
print_status $? $LOGDIR/update_ohs_route.log
printf "\n\t\t\tChanging $OLD_HOST2 to $NEW_HOST2 - "
sed -i "s/$OLD_HOST2/$NEW_HOST2/g" $WORKDIR/*_vh.conf >> $LOGDIR/update_ohs_route.log 2>&1
print_status $? $LOGDIR/update_ohs_route.log

ET=$(date +%s)
print_time STEP "Change OHS Routing" $ST $ET >> $LOGDIR/timings.log
}


update_ohs_hostname()
{
print_msg "Change OHS Virtual Host Name "
ST=$(date +%s)
OLD_HOSTNAME=$( grep "<VirtualHost" $WORKDIR/*.conf | cut -f2 -d: | awk '{ print $2 }' | head -1 )
mkdir $WORKDIR/$OHS_HOST1 2>/dev/null
cp $WORKDIR/*.conf $WORKDIR/$OHS_HOST1
if [ ! "$OLD_HOSTNAME" = "$OHS_HOST1" ]
then
printf "\n\t\t\tChanging $OLD_HOSTNAME to $OHS_HOST1 - "
sed -i "s/$OLD_HOSTNAME/$OHS_HOST1/" $WORKDIR/$OHS_HOST1/*.conf > $LOGDIR/update_vh.log 2>&1
print_status $? $LOGDIR/update_vh.log
fi

if [ ! "$OHS_HOST2" = "" ]
then
mkdir $WORKDIR/$OHS_HOST2 2>/dev/null
cp $WORKDIR/*.conf $WORKDIR/$OHS_HOST2
printf "\n\t\t\tChanging $OLD_HOSTNAME to $OHS_HOST2 - "
sed -i "s/$OLD_HOSTNAME/$OHS_HOST2/" $WORKDIR/$OHS_HOST2/*.conf >> $LOGDIR/update_vh.log 2>&1
print_status $? $LOGDIR/update_vh.log
fi
ET=$(date +%s)
print_time STEP "Change OHS Virtual HostName" $ST $ET >> $LOGDIR/timings.log
}


copy_ohs_dr_config()
{
print_msg "Copy OHS Config"
ST=$(date +%s)

printf "\t\t\tCopy OHS Config to $OHS_HOST1 - "
$SCP $WORKDIR/$OHS_HOST1/*vh.conf $OHS_HOST1:$OHS_DOMAIN/config/fmwconfig/components/OHS/$OHS1_NAME/moduleconf/ > $LOGDIR/copy_ohs_config.log 2>&1
print_status $? $LOGDIR/copy_ohs_config.log

if [ ! "$OHS_HOST2" = "" ]
then
printf "\t\t\tCopy OHS Config to $OHS_HOST2 - "
$SCP $WORKDIR/$OHS_HOST2/*vh.conf $OHS_HOST2:$OHS_DOMAIN/config/fmwconfig/components/OHS/$OHS2_NAME/moduleconf/ > $LOGDIR/copy_ohs_config.log 2>&1
print_status $? $LOGDIR/copy_ohs_config.log
fi
ET=$(date +%s)
print_time STEP "Change OHS Routing" $ST $ET >> $LOGDIR/timings.log
}
Loading

0 comments on commit daaf05e

Please sign in to comment.