Skip to content

Commit 6d181ba

Browse files
authored
Merge branch 'master' into wdt_issue_246
2 parents cfb5efa + 3058d27 commit 6d181ba

File tree

10 files changed

+64
-8
lines changed

10 files changed

+64
-8
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ In the example above, the `Target` attribute is specified three different ways,
218218

219219
One of the primary goals of the WebLogic Deploy Tooling is to support a sparse model where the user can specify just the configuration needed for a particular situation. What this implies varies somewhat between the tools but, in general, this implies that the tools are using an additive model. That is, the tools add to what is already there in the existing domain or domain templates (when creating a new domain) rather than making the domain conform exactly to the specified model. Where it makes sense, a similar, additive approach is taken when setting the value of multi-valued attributes. For example, if the model specified the cluster `mycluster` as the target for an artifact, the tooling will add `mycluster` to any existing list of targets for the artifact. While the development team has tried to mark attributes that do not make sense to merge accordingly in our knowledge base, this behavior can be disabled on an attribute-by-attribute basis, by adding an additional annotation in the knowledge base data files. The development team is already thinking about how to handle situations that require a non-additive, converge-to-the-model approach, and how that might be supported, but this still remains a wish list item. Users with these requirements should raise an issue for this support.
220220

221+
### Using Multiple Models
222+
223+
The Create Domain, Update Domain, Deploy Applications, and Validate Model tools allow the specification of multiple models on the command line. For example:
224+
225+
weblogic-deploy\bin\createDomain.cmd -model_file modelOne,modelTwo,modelThree ...
226+
227+
In this case, the models are merged into a single model before being applied. Each successive model is layered onto the previous ones, so any existing values from the previous models are overwritten. The resulting model is then verified before being applied.
228+
221229
## Downloading and Installing the Software
222230

223231
The Oracle WebLogic Server Deploy Tooling project repository is located at [`https://github.com/oracle/weblogic-deploy-tooling`](https://github.com/oracle/weblogic-deploy-tooling). Binary distributions of the `weblogic-deploy.zip` installer can be downloaded from the [GitHub Releases page](https://github.com/oracle/weblogic-deploy-tooling/releases). To install the software, simply unzip the `weblogic-deploy.zip` installer on a machine that has the desired versions of WebLogic Server installed. After being unzipped, the software is ready to use, just set the `JAVA_HOME` environment variable to point to a Java 7 or higher JDK and the shell scripts are ready to run.

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<parent>
1212
<artifactId>weblogic-deploy</artifactId>
1313
<groupId>com.oracle.weblogic.lifecycle</groupId>
14-
<version>1.1.1-SNAPSHOT</version>
14+
<version>1.1.2-SNAPSHOT</version>
1515
<relativePath>../pom.xml</relativePath>
1616
</parent>
1717

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
The Universal Permissive License (UPL), Version 1.0
44
"""
55
import javaos as os
6+
from java.util import Properties
7+
from java.io import FileOutputStream
68
from oracle.weblogic.deploy.create import RCURunner
79
from wlsdeploy.aliases.location_context import LocationContext
810
from wlsdeploy.aliases.model_constants import ADMIN_PASSWORD
@@ -80,6 +82,8 @@
8082
from wlsdeploy.tool.util.topology_helper import TopologyHelper
8183
from wlsdeploy.util import dictionary_utils
8284
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
8387

8488

8589
class DomainCreator(Creator):
@@ -161,6 +165,7 @@ def create(self):
161165
self.__fail_mt_1221_domain_creation()
162166
self.__create_domain()
163167
self.__deploy()
168+
self.__create_boot_dot_properties()
164169
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
165170
return
166171

@@ -302,7 +307,6 @@ def __fail_mt_1221_domain_creation(self):
302307
(not dictionary_utils.is_empty_dictionary_element(resources_dict, RESOURCE_GROUP_TEMPLATE)) or \
303308
(not dictionary_utils.is_empty_dictionary_element(resources_dict, RESOURCE_GROUP)) or \
304309
(not dictionary_utils.is_empty_dictionary_element(resources_dict, PARTITION)):
305-
306310
ex = exception_helper.create_create_exception('WLSDPLY-12202', self.wls_helper.wl_version)
307311
self.logger.throwing(ex, class_name=self.__class_name, method_name=_method_name)
308312
raise ex
@@ -1093,3 +1097,34 @@ def _configure_security_configuration(self):
10931097
self.security_provider_creator.create_security_configuration(security_config_location)
10941098
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
10951099
return
1100+
1101+
def __create_boot_dot_properties(self):
1102+
_method_name = '__create_boot_dot_properties'
1103+
self.logger.entering(class_name=self.__class_name, method_name=_method_name)
1104+
systemIni = SerializedSystemIni.getEncryptionService(self._domain_home)
1105+
encryptionService = ClearOrEncryptedService(systemIni)
1106+
admin_password = self._domain_info[ADMIN_PASSWORD]
1107+
admin_username = self.wls_helper.get_default_admin_username()
1108+
if ADMIN_USERNAME in self._domain_info:
1109+
admin_username = self._domain_info[ADMIN_USERNAME]
1110+
1111+
server_nodes = dictionary_utils.get_dictionary_element(self._topology, SERVER)
1112+
servers = [self._admin_server_name]
1113+
1114+
for model_name in server_nodes:
1115+
name = self.wlst_helper.get_quoted_name_for_wlst(model_name)
1116+
servers.append(name)
1117+
1118+
for server in servers:
1119+
properties = Properties()
1120+
properties.put("username", encryptionService.encrypt(admin_username))
1121+
properties.put("password", encryptionService.encrypt(admin_password))
1122+
file_directory = self._domain_home + "/servers/" + server + "/security"
1123+
file_location = file_directory + "/boot.properties"
1124+
if not os.path.exists(file_directory):
1125+
os.makedirs(file_directory)
1126+
ostream = FileOutputStream(file_location)
1127+
properties.store(ostream, None)
1128+
ostream.close()
1129+
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
1130+
return

core/src/main/python/wlsdeploy/util/cla_helper.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
from wlsdeploy.util import cla_utils
1313
from wlsdeploy.util.cla_utils import CommandLineArgUtil
1414
from wlsdeploy.util.model_translator import FileToPython
15-
from wlsdeploy.yaml.yaml_translator import PythonToYaml
1615

1716
import oracle.weblogic.deploy.util.PyOrderedDict as OrderedDict
1817

@@ -130,8 +129,6 @@ def merge_model_files(model_file_value):
130129
model = FileToPython(model_file, True).parse()
131130
_merge_dictionaries(merged_model, model)
132131

133-
PythonToYaml(merged_model).write_to_yaml_file("C:/tmp/mergedModel.yaml")
134-
135132
return merged_model
136133

137134

installer/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<parent>
1313
<groupId>com.oracle.weblogic.lifecycle</groupId>
1414
<artifactId>weblogic-deploy</artifactId>
15-
<version>1.1.1-SNAPSHOT</version>
15+
<version>1.1.2-SNAPSHOT</version>
1616
<relativePath>../pom.xml</relativePath>
1717
</parent>
1818

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<groupId>com.oracle.weblogic.lifecycle</groupId>
1010
<artifactId>weblogic-deploy</artifactId>
11-
<version>1.1.1-SNAPSHOT</version>
11+
<version>1.1.2-SNAPSHOT</version>
1212
<packaging>pom</packaging>
1313

1414
<name>Oracle WebLogic Server Deploy Tooling</name>

site/create.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,10 @@ It is also possible to specify the connection information in the model instead o
2323

2424
To create more complex domains, it may be necessary to create a custom domain type. This is useful for cases where the domain has custom templates, or templates for other Oracle products. For more information, refer to [Domain Type Definitions](type_def.md).
2525

26-
One last note is that if the model or variables file contains encrypted passwords, add the `-use_encryption` flag to the command line to tell the Create Domain Tool that encryption is being used and to prompt for the encryption passphrase. As with the database passwords, the tool can also read the passphrase from standard input (for example, `stdin`) to allow the tool to run without any user input.
26+
### Using an Encrypted Model
27+
28+
If the model or variables file contains encrypted passwords, add the `-use_encryption` flag to the command line to tell the Create Domain Tool that encryption is being used and to prompt for the encryption passphrase. As with the database passwords, the tool can also read the passphrase from standard input (for example, `stdin`) to allow the tool to run without any user input.
29+
30+
### Using Multiple Models
31+
32+
The Create Domain Tool supports the use of multiple models, as described in [Using Multiple Models](../README.md#using-multiple-models).

site/deploy.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ When running the tool in WLST online mode, the deploy operation may require serv
2929
- `102` - The servers impacted by the deploy operation need to be restarted, in a rolling fashion, starting with the Administration Server, if applicable.
3030
- `103` - The entire domain needs to be restarted.
3131

32+
### Using Multiple Models
33+
34+
The Deploy Applications Tool supports the use of multiple models, as described in [Using Multiple Models](../README.md#using-multiple-models).

site/update.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ When running the tool in WLST online mode, the update operation may require serv
2323
- `101` - The domain needs to be restarted and the Update Domain Tool needs to be re-invoked with the same arguments.
2424
- `102` - The servers impacted by the update operation need to be restarted, in a rolling fashion, starting with the Administration Server, if applicable.
2525
- `103` - The entire domain needs to be restarted.
26+
27+
### Using Multiple Models
28+
29+
The Update Domain Tool supports the use of multiple models, as described in [Using Multiple Models](../README.md#using-multiple-models).

site/validate.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,6 @@ Results in output similar to that shown below, if the `simpleear.ear` file is no
100100
Errors: 1
101101
Message: Model location appDeployments:/Application/simpleear/SourcePath references file wlsdeploy/applications/simpleear.ear that is not found in the archive file D:/demo/InvalidDemoDomain.zip
102102

103+
### Using Multiple Models
104+
105+
The Validate Model Tool supports the use of multiple models, as described in [Using Multiple Models](../README.md#using-multiple-models).

0 commit comments

Comments
 (0)