|
3 | 3 | The Universal Permissive License (UPL), Version 1.0 |
4 | 4 | """ |
5 | 5 | import javaos as os |
6 | | -from java.util import Properties |
| 6 | +import weblogic.security.internal.SerializedSystemIni as SerializedSystemIni |
| 7 | +import weblogic.security.internal.encryption.ClearOrEncryptedService as ClearOrEncryptedService |
7 | 8 | from java.io import FileOutputStream |
| 9 | +from java.util import Properties |
8 | 10 | from oracle.weblogic.deploy.create import RCURunner |
| 11 | +from oracle.weblogic.deploy.util import WLSDeployArchive, FileUtils |
9 | 12 | from wlsdeploy.aliases.location_context import LocationContext |
10 | 13 | from wlsdeploy.aliases.model_constants import ADMIN_PASSWORD |
11 | 14 | from wlsdeploy.aliases.model_constants import ADMIN_SERVER_NAME |
12 | 15 | from wlsdeploy.aliases.model_constants import ADMIN_USERNAME |
13 | 16 | from wlsdeploy.aliases.model_constants import APP_DIR |
14 | 17 | from wlsdeploy.aliases.model_constants import ATP_ADMIN_USER |
15 | | -from wlsdeploy.aliases.model_constants import ATP_TNS_ENTRY |
16 | 18 | from wlsdeploy.aliases.model_constants import ATP_DEFAULT_TABLESPACE |
17 | 19 | from wlsdeploy.aliases.model_constants import ATP_TEMPORARY_TABLESPACE |
| 20 | +from wlsdeploy.aliases.model_constants import ATP_TNS_ENTRY |
18 | 21 | from wlsdeploy.aliases.model_constants import CLUSTER |
19 | 22 | from wlsdeploy.aliases.model_constants import CREATE_ONLY_DOMAIN_ATTRIBUTES |
20 | 23 | from wlsdeploy.aliases.model_constants import DEFAULT_ADMIN_SERVER_NAME |
|
41 | 44 | from wlsdeploy.aliases.model_constants import MACHINE |
42 | 45 | from wlsdeploy.aliases.model_constants import MIGRATABLE_TARGET |
43 | 46 | from wlsdeploy.aliases.model_constants import NAME |
| 47 | +from wlsdeploy.aliases.model_constants import OPSS_SECRETS |
44 | 48 | from wlsdeploy.aliases.model_constants import PARTITION |
45 | 49 | from wlsdeploy.aliases.model_constants import PASSWORD |
46 | 50 | from wlsdeploy.aliases.model_constants import PASSWORD_ENCRYPTED |
| 51 | +from wlsdeploy.aliases.model_constants import RCU_ADMIN_PASSWORD |
47 | 52 | from wlsdeploy.aliases.model_constants import RCU_DB_CONN |
48 | 53 | from wlsdeploy.aliases.model_constants import RCU_DB_INFO |
49 | 54 | from wlsdeploy.aliases.model_constants import RCU_PREFIX |
50 | 55 | from wlsdeploy.aliases.model_constants import RCU_SCHEMA_PASSWORD |
51 | | -from wlsdeploy.aliases.model_constants import RCU_ADMIN_PASSWORD |
52 | 56 | from wlsdeploy.aliases.model_constants import RESOURCE_GROUP |
53 | 57 | from wlsdeploy.aliases.model_constants import RESOURCE_GROUP_TEMPLATE |
54 | 58 | from wlsdeploy.aliases.model_constants import SECURITY |
|
70 | 74 | from wlsdeploy.exception import exception_helper |
71 | 75 | from wlsdeploy.exception.expection_types import ExceptionType |
72 | 76 | from wlsdeploy.tool.create import atp_helper |
73 | | -from wlsdeploy.tool.create.rcudbinfo_helper import RcuDbInfo |
74 | 77 | from wlsdeploy.tool.create.creator import Creator |
| 78 | +from wlsdeploy.tool.create.rcudbinfo_helper import RcuDbInfo |
75 | 79 | from wlsdeploy.tool.create.security_provider_creator import SecurityProviderCreator |
76 | 80 | from wlsdeploy.tool.deploy import deployer_utils |
77 | 81 | from wlsdeploy.tool.deploy import model_deployer |
|
82 | 86 | from wlsdeploy.tool.util.topology_helper import TopologyHelper |
83 | 87 | from wlsdeploy.util import dictionary_utils |
84 | 88 | from wlsdeploy.util import model as model_helper |
85 | | -import weblogic.security.internal.SerializedSystemIni as SerializedSystemIni |
86 | | -import weblogic.security.internal.encryption.ClearOrEncryptedService as ClearOrEncryptedService |
87 | 89 |
|
88 | 90 |
|
89 | 91 | class DomainCreator(Creator): |
@@ -349,6 +351,7 @@ def __deploy(self): |
349 | 351 | self.__set_domain_attributes() |
350 | 352 | self._configure_security_configuration() |
351 | 353 | self.__deploy_resources_and_apps() |
| 354 | + self.__configure_opss_secrets() |
352 | 355 | self.wlst_helper.update_domain() |
353 | 356 | self.wlst_helper.close_domain() |
354 | 357 | return |
@@ -1128,3 +1131,20 @@ def __create_boot_dot_properties(self): |
1128 | 1131 | ostream.close() |
1129 | 1132 | self.logger.exiting(class_name=self.__class_name, method_name=_method_name) |
1130 | 1133 | return |
| 1134 | + |
| 1135 | + def __configure_opss_secrets(self): |
| 1136 | + _method_name = '__configure_opss_secrets' |
| 1137 | + self.logger.entering(class_name=self.__class_name, method_name=_method_name) |
| 1138 | + extract_path = None |
| 1139 | + domain_info = self._domain_info |
| 1140 | + if domain_info is not None: |
| 1141 | + if OPSS_SECRETS in domain_info: |
| 1142 | + opss_secret_password = domain_info[OPSS_SECRETS] |
| 1143 | + if self.model_context.get_archive_file_name() and opss_secret_password: |
| 1144 | + archive_file = WLSDeployArchive(self.model_context.get_archive_file_name()) |
| 1145 | + extract_path = self._domain_home + os.sep + 'opsswallet' |
| 1146 | + zip_entry = archive_file.getOPSSWallet(); |
| 1147 | + FileUtils.extractZipFileContent(archive_file, zip_entry, extract_path) |
| 1148 | + self.wlst_helper.setSharedSecretStoreWithPassword(extract_path, opss_secret_password) |
| 1149 | + self.logger.exiting(class_name=self.__class_name, method_name=_method_name) |
| 1150 | + return extract_path |
0 commit comments