Skip to content

Commit 42c4f49

Browse files
authored
Fix in OIM MAA (#95)
1 parent 93ac657 commit 42c4f49

File tree

8 files changed

+117
-49
lines changed

8 files changed

+117
-49
lines changed

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/common/functions.sh

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2021, Oracle and/or its affiliates.
2+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
#
55
# This is an example of common functions and procedures used by the provisioning and deletion scripts
@@ -749,48 +749,48 @@ create_schemas ()
749749
printf "$RCUPWD\n" >> /tmp/pwd.txt
750750
print_msg "Creating $SCHEMA_TYPE Schemas"
751751

752-
printf "#!/bin/bash\n" > /tmp/create_schema.sh
753-
printf "/u01/oracle/oracle_common/bin/rcu -silent -createRepository -databaseType ORACLE " >> /tmp/create_schema.sh
754-
printf " -connectString $DB_HOST:$DB_PORT/$DB_SERVICE " >> /tmp/create_schema.sh
755-
printf " -dbUser sys -dbRole sysdba -useSamePasswordForAllSchemaUsers true -selectDependentsForComponents true " >> /tmp/create_schema.sh
756-
printf " -schemaPrefix $RCU_PREFIX" >> /tmp/create_schema.sh
752+
printf "#!/bin/bash\n" > $WORKDIR/create_schema.sh
753+
printf "/u01/oracle/oracle_common/bin/rcu -silent -createRepository -databaseType ORACLE " >> $WORKDIR/create_schema.sh
754+
printf " -connectString $DB_HOST:$DB_PORT/$DB_SERVICE " >> $WORKDIR/create_schema.sh
755+
printf " -dbUser sys -dbRole sysdba -useSamePasswordForAllSchemaUsers true -selectDependentsForComponents true " >> $WORKDIR/create_schema.sh
756+
printf " -schemaPrefix $RCU_PREFIX" >> $WORKDIR/create_schema.sh
757757

758758
if [ "$SCHEMA_TYPE" = "OIG" ]
759759
then
760-
printf "$OIG_SCHEMAS" >> /tmp/create_schema.sh
760+
printf "$OIG_SCHEMAS" >> $WORKDIR/create_schema.sh
761761
elif [ "$SCHEMA_TYPE" = "OAM" ]
762762
then
763-
printf "$OAM_SCHEMAS" >> /tmp/create_schema.sh
763+
printf "$OAM_SCHEMAS" >> $WORKDIR/create_schema.sh
764764
else
765765
printf "\nInvalid Schema Type: $SCHEMA_TYPE \n"
766766
exit 1
767767
fi
768768

769-
printf " -f < /tmp/pwd.txt \n" >> /tmp/create_schema.sh
770-
printf " exit \n" >> /tmp/create_schema.sh
769+
printf " -f < /tmp/pwd.txt \n" >> $WORKDIR/create_schema.sh
770+
printf " exit \n" >> $WORKDIR/create_schema.sh
771771

772772
kubectl cp /tmp/pwd.txt $NAMESPACE/helper:/tmp
773-
kubectl cp /tmp/create_schema.sh $NAMESPACE/helper:/tmp
773+
kubectl cp $WORKDIR/create_schema.sh $NAMESPACE/helper:/tmp
774774
kubectl exec -n $NAMESPACE -ti helper -- /bin/bash < /tmp/create_schema.sh > $LOGDIR/create_schemas.log 2>&1
775775
print_status $? $LOGDIR/create_schemas.log
776776
if [ "$SCHEMA_TYPE" = "OIG" ]
777777
then
778778
printf "\t\t\tPatching OIM Schema - "
779-
printf "/u01/oracle/oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin/ant " >> /tmp/patch_schema.sh
780-
printf " -f /u01/oracle/idm/server/setup/deploy-files/automation.xml " >> /tmp/patch_schema.sh
781-
printf " run-patched-sql-files " >> /tmp/patch_schema.sh
782-
printf " -logger org.apache.tools.ant.NoBannerLogger " >> /tmp/patch_schema.sh
783-
printf " -logfile /tmp/patch_oim_wls.log " >> /tmp/patch_schema.sh
784-
printf " -DoperationsDB.host=$DB_HOST" >> /tmp/patch_schema.sh
785-
printf " -DoperationsDB.port=$DB_PORT " >> /tmp/patch_schema.sh
786-
printf " -DoperationsDB.serviceName=$DB_SERVICE " >> /tmp/patch_schema.sh
787-
printf " -DoperationsDB.user=${RCU_PREFIX}_OIM " >> /tmp/patch_schema.sh
788-
printf " -DOIM.DBPassword=$RCUPWD " >> /tmp/patch_schema.sh
789-
printf " -Dojdbc=/u01/oracle/oracle_common/modules/oracle.jdbc/ojdbc8.jar \n" >> /tmp/patch_schema.sh
790-
printf "exit \n" >> /tmp/patch_schema.sh
791-
792-
793-
kubectl cp /tmp/create_schema.sh $NAMESPACE/helper:/tmp
779+
printf "/u01/oracle/oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin/ant " >> $WORKDIR/patch_schema.sh
780+
printf " -f /u01/oracle/idm/server/setup/deploy-files/automation.xml " >> $WORKDIR/patch_schema.sh
781+
printf " run-patched-sql-files " >> $WORKDIR/patch_schema.sh
782+
printf " -logger org.apache.tools.ant.NoBannerLogger " >> $WORKDIR/patch_schema.sh
783+
printf " -logfile /tmp/patch_oim_wls.log " >> $WORKDIR/patch_schema.sh
784+
printf " -DoperationsDB.host=$DB_HOST" >> $WORKDIR/patch_schema.sh
785+
printf " -DoperationsDB.port=$DB_PORT " >> $WORKDIR/patch_schema.sh
786+
printf " -DoperationsDB.serviceName=$DB_SERVICE " >> $WORKDIR/patch_schema.sh
787+
printf " -DoperationsDB.user=${RCU_PREFIX}_OIM " >> $WORKDIR/patch_schema.sh
788+
printf " -DOIM.DBPassword=$RCUPWD " >> $WORKDIR/patch_schema.sh
789+
printf " -Dojdbc=/u01/oracle/oracle_common/modules/oracle.jdbc/ojdbc8.jar \n" >> $WORKDIR/patch_schema.sh
790+
printf "exit \n" >> $WORKDIR/patch_schema.sh
791+
792+
793+
kubectl cp $WORKDIR/patch_schema.sh $NAMESPACE/helper:/tmp
794794
kubectl exec -n $NAMESPACE -ti helper -- /bin/bash < /tmp/patch_schema.sh > $LOGDIR/patch_schema.log 2>&1
795795
kubectl cp $NAMESPACE/helper:/tmp/patch_oim_wls.log $LOGDIR/patch_oim_wls.log > /dev/null
796796
grep -q "BUILD SUCCESSFUL" $LOGDIR/patch_oim_wls.log

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/common/oam_functions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, Oracle and/or its affiliates.
1+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# This is an example of procedures used to configure OAM
@@ -435,7 +435,7 @@ run_idmConfigTool()
435435
printf "\t\t\tChecking Log File - "
436436
copy_from_k8 $PV_MOUNT/workdir/configoam.log $WORKDIR/logs/configoam.log $OAMNS $OAM_DOMAIN_NAME
437437

438-
grep -q SEVERE $WORKDIR/logs/configoam.log | grep -v simple
438+
grep SEVERE $WORKDIR/logs/configoam.log | grep -v simple > /dev/null
439439
if [ $? = 0 ]
440440
then
441441
echo "Failed - Check logifle $WORKDIR/logs/configoam.log"

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/common/oig_functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, Oracle and/or its affiliates.
1+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# This is an example of functions and procedures to provision and Configure Oracle Identity Governance

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/common/oiri_functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, Oracle and/or its affiliates.
1+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# This is an example of functions and procedures to provision and Configure Oracle Identity Role Intelligence

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/common/oud_functions.sh

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, Oracle and/or its affiliates.
1+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
33
#
44
# This is an example of the checks that can be performed before Provisioning Identity Management
@@ -161,6 +161,63 @@ create_oud_nodeport()
161161
print_time STEP "Create OUD Nodeport services" $ST $ET >> $LOGDIR/timings.log
162162
}
163163

164+
# Check Validate OUD Dataload was successful
165+
#
166+
validate_oud()
167+
{
168+
ST=`date +%s`
169+
print_msg "Validating OUD"
170+
echo "Validating OUD" > $LOGDIR/validate_oud.log
171+
echo "--------------" >> $LOGDIR/validate_oud.log
172+
echo "" >> $LOGDIR/validate_oud.log
173+
FAIL=0
174+
175+
printf "\n\t\t\tChecking for Import Errors - "
176+
grep -q ERROR $OUD_LOCAL_PVSHARE/${OUD_POD_PREFIX}-oud-ds-rs-0/logs/importLdifCmd.log
177+
if [ $? = 0 ]
178+
then
179+
echo "Import Errors Found check logfile $OUD_LOCAL_PVSHARE/${OUD_POD_PREFIX}-oud-ds-rs-0/logs/importLdifCmd.log"
180+
echo "Import Errors Found check logfile $OUD_LOCAL_PVSHARE/${OUD_POD_PREFIX}-oud-ds-rs-0/logs/importLdifCmd.log" >> $LOGDIR/validate_oud.log
181+
FAIL=1
182+
else
183+
echo "No Errors"
184+
echo "No Import Errors discovered" >> $LOGDIR/validate_oud.log
185+
fi
186+
printf "\t\t\tChecking for Rejects - "
187+
if [ -s $OUD_LOCAL_SHARE/rejects.ldif ]
188+
then
189+
echo "Rejects found check File: $OUD_LOCAL_SHARE/rejects.ldif"
190+
echo "Rejects found check File: $OUD_LOCAL_SHARE/rejects.ldif" >> $LOGDIR/validate_oud.log
191+
FAIL=1
192+
else
193+
echo "No Rejects found"
194+
echo "No Reject Errors discovered" >> $LOGDIR/validate_oud.log
195+
fi
196+
printf "\t\t\tChecking for Skipped Records - "
197+
if [ -s $OUD_LOCAL_SHARE/skip.ldif ]
198+
then
199+
echo "Skipped Records found check File: $OUD_LOCAL_SHARE/skip.ldif"
200+
echo "Skipped Records found check File: $OUD_LOCAL_SHARE/skip.ldif" >> $LOGDIR/validate_oud.log
201+
FAIL=1
202+
else
203+
echo "No Skipped Records found"
204+
echo "No Skipped Records discovered" >> $LOGDIR/validate_oud.log
205+
fi
206+
207+
208+
if [ "$FAIL" = "1" ]
209+
then
210+
printf "\n\t\t\tOUD Vaildation Failed\n"
211+
exit 1
212+
else
213+
printf "\n\t\t\tOUD Vaildation Succeeded\n"
214+
fi
215+
216+
217+
218+
ET=`date +%s`
219+
print_time STEP "Validating OUD" $ST $ET >> $LOGDIR/timings.log
220+
}
164221
create_ingress()
165222
{
166223
ST=`date +%s`
@@ -179,6 +236,7 @@ create_ingress()
179236
ET=`date +%s`
180237
print_time STEP "Creating Ingress" $ST $ET >> $LOGDIR/timings.log
181238
}
239+
182240
# Create a Helm override file to deploy OUDSM
183241
#
184242
create_oudsm_override()

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/provision_oud.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2021, Oracle and/or its affiliates.
2+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
#
55
# This is an example of deploying Oracle Unified Directory, configuring it for use with Oracle Access Manager
@@ -127,6 +127,15 @@ then
127127
update_progress
128128
fi
129129

130+
# Valiate OUD
131+
#
132+
new_step
133+
if [ $STEPNO -gt $PROGRESS ]
134+
then
135+
validate_oud
136+
update_progress
137+
fi
138+
130139
# Setup Ingress if required Otherwise create NodePort Services
131140
#
132141
if [ "$USE_INGRESS" = "true" ]

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/start_here.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2021, Oracle and/or its affiliates.
2+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
#
55
# This is an example script to populate the responsefile
@@ -392,6 +392,7 @@ then
392392
if [ ! "$ANS" = "" ]
393393
then
394394
global_replace_value $OLD_SEARCHBASE $ANS $RSPFILE
395+
OUD_SEARCHBASE=$ANS
395396
OUD_REGION=`echo $ANS | cut -f1 -d, | cut -f2 -d=`
396397
replace_value OUD_REGION $OUD_REGION $RSPFILE
397398
OAM_COOKIE_DOMAIN=`echo $OUD_SEARCHBASE | sed 's/dc=/./g;s/,//g'`
@@ -509,8 +510,8 @@ fi
509510
if [ "$INSTALL_OUDSM" = "true" ]
510511
then
511512
echo
512-
echo "OUDSM Paramters"
513-
echo "---------------"
513+
echo "OUDSM Parameters"
514+
echo "----------------"
514515
echo
515516
echo -n "Enter OUDSM Image Name [$OUDSM_IMAGE]:"
516517
read ANS
@@ -580,8 +581,8 @@ fi
580581
if [ "$INSTALL_OAM" = "true" ] || [ "$INSTALL_OIG" = "true" ]
581582
then
582583
echo
583-
echo "WebLogic Operator Paramters"
584-
echo "---------------------------"
584+
echo "WebLogic Operator Parameters"
585+
echo "----------------------------"
585586
echo
586587

587588
if [ "$GET_NS" = "true" ]
@@ -611,8 +612,8 @@ fi
611612
if [ "$INSTALL_OAM" = "true" ]
612613
then
613614
echo
614-
echo "Oracle Access Manager Paramters"
615-
echo "-------------------------------"
615+
echo "Oracle Access Manager Parameters"
616+
echo "--------------------------------"
616617
echo
617618

618619
echo -n "Enter OAM Image Name [$OAM_IMAGE]:"
@@ -870,8 +871,8 @@ fi
870871
if [ "$INSTALL_OIG" = "true" ]
871872
then
872873
echo
873-
echo "Oracle Identity Governance Paramters"
874-
echo "------------------------------------"
874+
echo "Oracle Identity Governance Parameters"
875+
echo "-------------------------------------"
875876
echo
876877

877878
echo -n "Enter OIG Image Name [$OIG_IMAGE]:"
@@ -1214,8 +1215,8 @@ fi
12141215
if [ "$INSTALL_OIRI" = "true" ]
12151216
then
12161217
echo
1217-
echo "Oracle Identity Role Intelligence Paramters"
1218-
echo "-------------------------------------------"
1218+
echo "Oracle Identity Role Intelligence Parameters"
1219+
echo "--------------------------------------------"
12191220
echo
12201221

12211222
echo -n "Enter OIRI Image Name [$OIRI_IMAGE]:"
@@ -1545,8 +1546,8 @@ then
15451546
fi
15461547
fi
15471548
echo
1548-
echo "Oracle HTTP Server Paramters"
1549-
echo "----------------------------"
1549+
echo "Oracle HTTP Server Parameters"
1550+
echo "-----------------------------"
15501551
echo
15511552

15521553
echo -n "Enter OHS1 Hostname [$OHS_HOST1]:"

FMWKubernetesMAA/OracleEnterpriseDeploymentAutomation/OracleIdentityManagement/templates/oud/override_oud.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, Oracle and/or its affiliates.
1+
# Copyright (c) 2021, 2022, Oracle and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
33
#
44
# This is an example of a helm override file to deploy OUD
@@ -54,7 +54,7 @@ baseOUD:
5454
- name: restartAfterSchemaConfig
5555
value: "true"
5656
- name: importLdif_1
57-
value: --append --replaceExisting --includeBranch dc=us,dc=oracle,dc=com --backendID userRoot --ldifFile /u01/oracle/config-input/base.ldif --rejectFile /u01/oracle/config-input/rejects.ldif --skipFile /u01/oracle/config-input/skip.ldif
57+
value: --append --replaceExisting --includeBranch ${baseDN} --backendID userRoot --ldifFile /u01/oracle/config-input/base.ldif --rejectFile /u01/oracle/config-input/rejects.ldif --skipFile /u01/oracle/config-input/skip.ldif
5858
- name: serverTuning
5959
value: -Xms1024m -Xmx2048m -d64 -XX:+UseCompressedOops -server -Xmn1g -XX:MaxTenuringThreshold=1 -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=60
6060
- name: dsconfig_1
@@ -64,9 +64,9 @@ baseOUD:
6464
- name: dsconfig_3
6565
value: set-access-control-handler-prop --add global-aci:"(target=\"ldap:///cn=changelog\")(targetattr=\"*\")(version 3.0; acl \"External changelog access\"; allow (read,search,compare,add,write,delete,export) groupdn=\"ldap:///cn=<OUD_OIGADMIN_GRP>,cn=groups,${baseDN}\";)"
6666
- name: dsconfig_4
67-
value: set-access-control-handler-prop --add global-aci:"(targetcontrol=\"1.3.6.1.4.1.26027.1.5.4 || 1.3.6.1.4.1.26027.2.3.4\")(version 3.0; acl \"<OUD_OIGADMIN_GRP> control access\"; allow(read) groupdn=\"ldap:///cn=<OUD_OIGADMIN_GRP>,cn=groups,dc=us,dc=oracle,dc=com\";)"
67+
value: set-access-control-handler-prop --add global-aci:"(targetcontrol=\"1.3.6.1.4.1.26027.1.5.4 || 1.3.6.1.4.1.26027.2.3.4\")(version 3.0; acl \"<OUD_OIGADMIN_GRP> control access\"; allow(read) groupdn=\"ldap:///cn=<OUD_OIGADMIN_GRP>,cn=groups,${baseDN}\";)"
6868
- name: dsconfig_5
69-
value: set-access-control-handler-prop --add global-aci:"(target=\"ldap:///\")(targetscope=\"base\")(targetattr=\"lastExternalChangelogCookie\")(version 3.0; acl \"User-Visible lastExternalChangelog\"; allow (read,search,compare) groupdn=\"ldap:///cn=<OUD_OIGADMIN_GRP>,cn=groups,dc=us,dc=oracle,dc=com\";)"
69+
value: set-access-control-handler-prop --add global-aci:"(target=\"ldap:///\")(targetscope=\"base\")(targetattr=\"lastExternalChangelogCookie\")(version 3.0; acl \"User-Visible lastExternalChangelog\"; allow (read,search,compare) groupdn=\"ldap:///cn=<OUD_OIGADMIN_GRP>,cn=groups,${baseDN}\";)"
7070
- name: dsconfig_6
7171
value: set-access-control-handler-prop --remove global-aci:"(targetcontrol=\"1.3.6.1.1.12 || 1.3.6.1.1.13.1 || 1.3.6.1.1.13.2 || 1.2.840.113556.1.4.319 || 1.2.826.0.1.3344810.2.3 || 2.16.840.1.113730.3.4.18 || 2.16.840.1.113730.3.4.9 || 1.2.840.113556.1.4.473 || 1.3.6.1.4.1.42.2.27.9.5.9\") (version 3.0; acl \"Authenticated users control access\"; allow(read) userdn=\"ldap:///all\";)"
7272
- name: dsconfig_7

0 commit comments

Comments
 (0)