Skip to content

Commit 09708ef

Browse files
authored
Merge pull request #361 from gnsuryan/main
Changes in Cluster offer related to default outbound access and azure security fixes
2 parents e0c2ddd + 608a3cb commit 09708ef

30 files changed

+883
-146
lines changed

weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode/src/main/scripts/addnode.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ function validateInput()
4646
echo_stderr "wlsDomainName is required. "
4747
fi
4848

49-
if [[ -z "$wlsUserName" || -z "$wlsPassword" ]]
49+
if [[ -z "$wlsUserName" || -z "$wlsShibboleth" ]]
5050
then
51-
echo_stderr "wlsUserName or wlsPassword is required. "
51+
echo_stderr "Weblogic username or password is required. "
5252
exit 1
5353
fi
5454

@@ -176,7 +176,7 @@ function create_managed_model()
176176
cat <<EOF >$wlsDomainPath/managed-domain.yaml
177177
domainInfo:
178178
AdminUserName: "$wlsUserName"
179-
AdminPassword: "$wlsPassword"
179+
AdminPassword: "$wlsShibboleth"
180180
ServerStartMode: prod
181181
topology:
182182
Name: "$wlsDomainName"
@@ -199,7 +199,7 @@ topology:
199199
Arguments: '${SERVER_STARTUP_ARGS}'
200200
SecurityConfiguration:
201201
NodeManagerUsername: "$wlsUserName"
202-
NodeManagerPasswordEncrypted: "$wlsPassword"
202+
NodeManagerPasswordEncrypted: "$wlsShibboleth"
203203
EOF
204204
}
205205

@@ -208,7 +208,7 @@ function create_machine_model()
208208
{
209209
echo "Creating machine name model for managed server $wlsServerName"
210210
cat <<EOF >$wlsDomainPath/add-machine.py
211-
connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL')
211+
connect('$wlsUserName','$wlsShibboleth','t3://$wlsAdminURL')
212212
edit("$wlsServerName")
213213
startEdit()
214214
cd('/')
@@ -234,7 +234,7 @@ function create_ms_server_model()
234234
235235
isCustomSSLEnabled='${isCustomSSLEnabled}'
236236
237-
connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL')
237+
connect('$wlsUserName','$wlsShibboleth','t3://$wlsAdminURL')
238238
edit("$wlsServerName")
239239
startEdit()
240240
cd('/')
@@ -438,7 +438,7 @@ function start_managed()
438438
{
439439
echo "Starting managed server $wlsServerName"
440440
cat <<EOF >$wlsDomainPath/start-server.py
441-
connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL')
441+
connect('$wlsUserName','$wlsShibboleth','t3://$wlsAdminURL')
442442
try:
443443
start('$wlsServerName', 'Server')
444444
except:
@@ -751,7 +751,7 @@ function configureCustomHostNameVerifier()
751751
{
752752
echo "configureCustomHostNameVerifier for domain $wlsDomainName for server $wlsServerName"
753753
cat <<EOF >${wlsDomainPath}/configureCustomHostNameVerifier.py
754-
connect('$wlsUserName','$wlsPassword','t3://$wlsAdminURL')
754+
connect('$wlsUserName','$wlsShibboleth','t3://$wlsAdminURL')
755755
try:
756756
edit("$wlsServerName")
757757
startEdit()
@@ -787,7 +787,7 @@ CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
787787
BASE_DIR="$(readlink -f ${CURR_DIR})"
788788

789789
#read arguments from stdin
790-
read wlsDomainName wlsUserName wlsPassword managedServerPrefix serverIndex wlsAdminURL wlsAdminHost oracleHome wlsDomainPath storageAccountName storageAccountKey mountpointPath wlsADSSLCer wlsLDAPPublicIP adServerHost appGWHostName enableELK elasticURI elasticUserName elasticPassword logsToIntegrate logIndex enableCoherence customDNSNameForAdminServer dnsLabelPrefix location isCustomSSLEnabled customIdentityKeyStoreBase64String customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreBase64String customTrustKeyStorePassPhrase customTrustKeyStoreType privateKeyAlias privateKeyPassPhrase
790+
read wlsDomainName wlsUserName wlsShibboleth managedServerPrefix serverIndex wlsAdminURL wlsAdminHost oracleHome wlsDomainPath storageAccountName storageAccountKey mountpointPath wlsADSSLCer wlsLDAPPublicIP adServerHost appGWHostName enableELK elasticURI elasticUserName elasticPassword logsToIntegrate logIndex enableCoherence customDNSNameForAdminServer dnsLabelPrefix location isCustomSSLEnabled customIdentityKeyStoreBase64String customIdentityKeyStorePassPhrase customIdentityKeyStoreType customTrustKeyStoreBase64String customTrustKeyStorePassPhrase customTrustKeyStoreType privateKeyAlias privateKeyPassPhrase
791791

792792
isCustomSSLEnabled="${isCustomSSLEnabled,,}"
793793

@@ -845,7 +845,7 @@ if [[ "${enableELK,,}" == "true" ]];then
845845
${oracleHome} \
846846
${wlsAdminURL} \
847847
${wlsUserName} \
848-
${wlsPassword} \
848+
${wlsShibboleth} \
849849
"admin" \
850850
${elasticURI} \
851851
${elasticUserName} \

weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/mainTemplate.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@
231231
"type": "string",
232232
"defaultValue": "[newGuid()]"
233233
},
234+
"guidTag": {
235+
"type": "string",
236+
"defaultValue": "[newGuid()]"
237+
},
234238
"hasDNSZones": {
235239
"type": "bool",
236240
"defaultValue": false,
@@ -505,6 +509,7 @@
505509
"const_appGatewaySSLCertOptionGenerateCert": "generateCert",
506510
"const_azureSubjectName": "[format('{0}.{1}.{2}', variables('name_domainLabelforApplicationGateway'), parameters('location'),'cloudapp.azure.com')]",
507511
"const_globalResourceNameSuffix": "[uniqueString(parameters('guidValue'))]",
512+
"const_guidTag": "[uniqueString(parameters('guidTag'))]",
508513
"const_vmSize": "[parameters('vmSize')]",
509514
"const_vmSizeCoherence": "[parameters('vmSizeSelectForCoherence')]",
510515
"name_adminVM": "[concat(parameters('adminVMNamePrefix'), variables('const_globalResourceNameSuffix'), 'VM')]",
@@ -517,12 +522,15 @@
517522
"name_dnszonesLinkedTemplateName": "dnszonesTemplate.json",
518523
"name_domainLabelforApplicationGateway": "[take(concat(variables('name_dnsNameforApplicationGateway'),'-',toLower(resourceGroup().name),'-',toLower(parameters('wlsDomainName'))),63)]",
519524
"name_keyVaultLinkedTemplateName": "_keyvaultWithNewCertTemplate.json",
525+
"name_postDeploymentUAMIRolesTemplate" : "postDeploymentUAMIRolesTemplate.json",
526+
"name_postDeploymentTemplate": "postDeploymentTemplate.json",
520527
"name_networkSecurityGroup": "[concat(parameters('dnsLabelPrefix'), '-nsg-', variables('const_globalResourceNameSuffix'))]",
521528
"name_nsgLinkedTemplateName": "nsgNestedTemplate.json",
522529
"name_managedVMNamePrefix": "[concat(parameters('managedServerPrefix'), variables('const_globalResourceNameSuffix'))]",
523530
"clusterTemplateRef": "[concat('cluster',if(parameters('enableCustomSSL'),'CustomSSL',''),'LinkedTemplate')]",
524531
"name_clusterTemplate": "clusterLinkedTemplate",
525532
"name_clusterCustomSSLTemplate": "clusterCustomSSLLinkedTemplate",
533+
"name_uamiForPostDeploymentScript" : "uamiForPostDeploymentScript",
526534
"name_keyVaultName": "[concat('wls-kv-', variables('const_globalResourceNameSuffix'))]",
527535
"name_secretName": "mySelfSignedCertificate",
528536
// If adding a new resource, add the resource identifier to the array below
@@ -607,6 +615,9 @@
607615
"_globalResourceNameSuffix": {
608616
"value": "[variables('const_globalResourceNameSuffix')]"
609617
},
618+
"const_guidTag":{
619+
"value": "[variables('const_guidTag')]"
620+
},
610621
"adminPasswordOrKey": {
611622
"value": "[parameters('adminPasswordOrKey')]"
612623
},
@@ -728,6 +739,9 @@
728739
"_globalResourceNameSuffix": {
729740
"value": "[variables('const_globalResourceNameSuffix')]"
730741
},
742+
"const_guidTag":{
743+
"value": "[variables('const_guidTag')]"
744+
},
731745
"adminPasswordOrKey": {
732746
"value": "[parameters('adminPasswordOrKey')]"
733747
},
@@ -1391,6 +1405,88 @@
13911405
}
13921406
}
13931407
},
1408+
{
1409+
"type": "Microsoft.Resources/deployments",
1410+
"apiVersion": "${azure.apiVersionForDeployment}",
1411+
"name": "[variables('name_uamiForPostDeploymentScript')]",
1412+
"condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'existing')]",
1413+
"tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]",
1414+
"dependsOn": [
1415+
"[resourceId('Microsoft.Resources/deployments', variables('clusterTemplateRef'))]",
1416+
"[resourceId('Microsoft.Resources/deployments', 'keyVaultwithSelfSignedAppGatewaySSLCert')]",
1417+
"[resourceId('Microsoft.Resources/deployments', 'appGatewayLinkedTemplate')]",
1418+
"[resourceId('Microsoft.Resources/deployments', 'dnszonesLinkedTemplate')]",
1419+
"[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]",
1420+
"[resourceId('Microsoft.Resources/deployments', 'coherenceTemplate')]",
1421+
"[resourceId('Microsoft.Resources/deployments', 'coherenceTemplateWithCustomSSL')]"
1422+
],
1423+
"properties": {
1424+
"mode": "Incremental",
1425+
"templateLink": {
1426+
"uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_postDeploymentUAMIRolesTemplate')))]",
1427+
"contentVersion": "1.0.0.0"
1428+
},
1429+
"parameters": {
1430+
"location": {
1431+
"value": "[parameters('location')]"
1432+
},
1433+
"_globalResourceNameSuffix": {
1434+
"value": "[variables('const_globalResourceNameSuffix')]"
1435+
},
1436+
"tagsByResource": {
1437+
"value": "[variables('obj_tagsByResources')]"
1438+
}
1439+
}
1440+
}
1441+
},
1442+
{
1443+
"type": "Microsoft.Resources/deployments",
1444+
"apiVersion": "${azure.apiVersionForDeployment}",
1445+
"name": "postDeplyment",
1446+
"condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'existing')]",
1447+
"tags": "[variables('obj_tagsByResources')['${identifier.resourcesDeployment}']]",
1448+
"dependsOn": [
1449+
"[resourceId('Microsoft.Resources/deployments', variables('clusterTemplateRef'))]",
1450+
"[resourceId('Microsoft.Resources/deployments', 'keyVaultwithSelfSignedAppGatewaySSLCert')]",
1451+
"[resourceId('Microsoft.Resources/deployments', 'appGatewayLinkedTemplate')]",
1452+
"[resourceId('Microsoft.Resources/deployments', 'dnszonesLinkedTemplate')]",
1453+
"[resourceId('Microsoft.Resources/deployments', 'dbLinkedTemplate')]",
1454+
"[resourceId('Microsoft.Resources/deployments', 'coherenceTemplate')]",
1455+
"[resourceId('Microsoft.Resources/deployments', 'coherenceTemplateWithCustomSSL')]",
1456+
"[resourceId('Microsoft.Resources/deployments', variables('name_uamiForPostDeploymentScript'))]"
1457+
1458+
],
1459+
"properties": {
1460+
"mode": "Incremental",
1461+
"templateLink": {
1462+
"uri": "[uri(parameters('_artifactsLocation'), concat('nestedtemplates/', variables('name_postDeploymentTemplate')))]",
1463+
"contentVersion": "1.0.0.0"
1464+
},
1465+
"parameters": {
1466+
"location": {
1467+
"value": "[parameters('location')]"
1468+
},
1469+
"_globalResourceNameSuffix": {
1470+
"value": "[variables('const_globalResourceNameSuffix')]"
1471+
},
1472+
"tagsByResource": {
1473+
"value": "[variables('obj_tagsByResources')]"
1474+
},
1475+
"const_guidTag":{
1476+
"value": "[variables('const_guidTag')]"
1477+
},
1478+
"_artifactsLocation": {
1479+
"value": "[parameters('_artifactsLocation')]"
1480+
},
1481+
"_artifactsLocationSasToken": {
1482+
"value": "[parameters('_artifactsLocationSasToken')]"
1483+
},
1484+
"userAssignedIdentityResourceId":{
1485+
"value": "[reference(variables('name_uamiForPostDeploymentScript'),'${azure.apiVersionForDeployment}').outputs.uamidForPostDeployment.value]"
1486+
}
1487+
}
1488+
}
1489+
},
13941490
{
13951491
"apiVersion": "${azure.apiVersionForDeployment}",
13961492
"name": "${cluster.end}",

weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/clusterCustomSSLTemplate.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
"description": "The suffix to be appended to the globally unique resource name"
2929
}
3030
},
31+
"const_guidTag" :{
32+
"type": "string",
33+
"metadata": {
34+
"description": "A unique tag for resources."
35+
}
36+
},
3137
"adminPasswordOrKey": {
3238
"type": "securestring",
3339
"metadata": {
@@ -163,7 +169,7 @@
163169
"description": "Select appropriate VM Size as per requirement"
164170
}
165171
},
166-
"virtualNetworkNewOrExisting": {
172+
"virtualNetworkNewOrExisting": {
167173
"type": "string",
168174
"defaultValue": "new",
169175
"allowedValues": [
@@ -582,8 +588,7 @@
582588
{
583589
"apiVersion": "${azure.apiVersionForPublicIPAddresses}",
584590
"type": "Microsoft.Network/publicIPAddresses",
585-
"tags": "[parameters('tagsByResource')['${identifier.publicIPAddresses}']]",
586-
"condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]",
591+
"tags": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),parameters('tagsByResource')['${identifier.publicIPAddresses}'],if(empty(parameters('tagsByResource')['${identifier.publicIPAddresses}']),createObject(parameters('const_guidTag'),''),union(parameters('tagsByResource')['${identifier.publicIPAddresses}'],createObject(parameters('const_guidTag'),''))))]",
587592
"name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress')))]",
588593
"location": "[parameters('location')]",
589594
"copy": {
@@ -664,14 +669,18 @@
664669
"count": "[parameters('numberOfInstances')]"
665670
},
666671
"dependsOn": [
667-
"[variables('name_virtualNetwork')]"
672+
"[variables('name_virtualNetwork')]",
673+
"publicIPLoop"
668674
],
669675
"properties": {
670676
"ipConfigurations": [
671677
{
672678
"name": "ipconfig1",
673679
"properties": {
674680
"privateIPAllocationMethod": "Dynamic",
681+
"publicIPAddress": {
682+
"id": "[resourceId('${identifier.publicIPAddresses}',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress'))))]"
683+
},
675684
"subnet": {
676685
"id": "[variables('ref_subnet')]"
677686
}

weblogic-azure-vm/arm-oraclelinux-wls-cluster/arm-oraclelinux-wls-cluster/src/main/arm/nestedtemplates/clusterTemplate.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
"description": "The suffix to be appended to the globally unique resource name"
2929
}
3030
},
31+
"const_guidTag" :{
32+
"type": "string",
33+
"metadata": {
34+
"description": "A unique tag for resources."
35+
}
36+
},
3137
"adminPasswordOrKey": {
3238
"type": "securestring",
3339
"metadata": {
@@ -511,8 +517,7 @@
511517
{
512518
"apiVersion": "${azure.apiVersionForPublicIPAddresses}",
513519
"type": "Microsoft.Network/publicIPAddresses",
514-
"tags": "[parameters('tagsByResource')['${identifier.publicIPAddresses}']]",
515-
"condition": "[equals(parameters('virtualNetworkNewOrExisting'), 'new')]",
520+
"tags": "[if(equals(parameters('virtualNetworkNewOrExisting'), 'new'),parameters('tagsByResource')['${identifier.publicIPAddresses}'],if(empty(parameters('tagsByResource')['${identifier.publicIPAddresses}']),createObject(parameters('const_guidTag'),''),union(parameters('tagsByResource')['${identifier.publicIPAddresses}'],createObject(parameters('const_guidTag'),''))))]",
516521
"name": "[if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress')))]",
517522
"location": "[parameters('location')]",
518523
"copy": {
@@ -592,14 +597,18 @@
592597
"count": "[parameters('numberOfInstances')]"
593598
},
594599
"dependsOn": [
595-
"[variables('name_virtualNetwork')]"
600+
"[variables('name_virtualNetwork')]",
601+
"publicIPLoop"
596602
],
597603
"properties": {
598604
"ipConfigurations": [
599605
{
600606
"name": "ipconfig1",
601607
"properties": {
602608
"privateIPAllocationMethod": "Dynamic",
609+
"publicIPAddress": {
610+
"id": "[resourceId('${identifier.publicIPAddresses}',if(equals(copyIndex(),0),concat(parameters('adminVMName'),variables('name_publicIPAddress')),concat(variables('const_managedVMPrefix'), copyIndex(),variables('name_publicIPAddress'))))]"
611+
},
603612
"subnet": {
604613
"id": "[variables('ref_subnet')]"
605614
}

0 commit comments

Comments
 (0)