Skip to content

Commit 2500556

Browse files
committed
Re-deploy servers and clusters after initial domain creation
1 parent 59cb390 commit 2500556

File tree

5 files changed

+30
-37
lines changed

5 files changed

+30
-37
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@
7070
from wlsdeploy.aliases.model_constants import USER
7171
from wlsdeploy.aliases.model_constants import VIRTUAL_TARGET
7272
from wlsdeploy.aliases.model_constants import WLS_USER_PASSWORD_CREDENTIAL_MAPPINGS
73-
from wlsdeploy.aliases.model_constants import WLS_DEFAULT_AUTHENTICATION
7473
from wlsdeploy.aliases.model_constants import WS_RELIABLE_DELIVERY_POLICY
7574
from wlsdeploy.aliases.model_constants import XML_ENTITY_CACHE
7675
from wlsdeploy.aliases.model_constants import XML_REGISTRY
@@ -640,8 +639,9 @@ def __apply_base_domain_config(self, topology_folder_list):
640639
self.__create_reliable_delivery_policy(location)
641640
topology_folder_list.remove(WS_RELIABLE_DELIVERY_POLICY)
642641

643-
# these deletions were intentionally skipped when these elements are first created.
644-
self.topology_helper.remove_deleted_clusters_and_servers(location, self._topology)
642+
# this second pass will re-establish any attributes that were changed by templates,
643+
# and process deletes and re-adds of named elements in the model order.
644+
self.__create_machines_clusters_and_servers()
645645
topology_folder_list.remove(MACHINE)
646646
topology_folder_list.remove(UNIX_MACHINE)
647647
topology_folder_list.remove(CLUSTER)

core/src/main/python/wlsdeploy/tool/deploy/topology_updater.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 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
from wlsdeploy.aliases.location_context import LocationContext
@@ -96,8 +96,9 @@ def update(self):
9696
self._process_section(self._topology, folder_list, ADMIN_CONSOLE, location)
9797
self._process_section(self._topology, folder_list, CDI_CONTAINER, location)
9898

99-
# these deletions were intentionally skipped when these elements are first created.
100-
self._topology_helper.remove_deleted_clusters_and_servers(location, self._topology)
99+
# this second pass will re-establish any attributes that were changed by templates,
100+
# and process deletes and re-adds of named elements in the model order.
101+
self.update_machines_clusters_and_servers()
101102
folder_list.remove(CLUSTER)
102103
folder_list.remove(SERVER)
103104
if SERVER_TEMPLATE in folder_list:

core/src/main/python/wlsdeploy/tool/util/attribute_setter.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates. All rights reserved.
2+
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. All rights reserved.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
from javax.management import ObjectName
@@ -16,6 +16,7 @@
1616
from wlsdeploy.aliases.model_constants import CONTEXT_REQUEST_CLASS
1717
from wlsdeploy.aliases.model_constants import DISTRIBUTED_QUEUE
1818
from wlsdeploy.aliases.model_constants import DISTRIBUTED_TOPIC
19+
from wlsdeploy.aliases.model_constants import ENABLED
1920
from wlsdeploy.aliases.model_constants import FAIR_SHARE_REQUEST_CLASS
2021
from wlsdeploy.aliases.model_constants import FILE_STORE
2122
from wlsdeploy.aliases.model_constants import HEAP_DUMP_ACTION
@@ -657,6 +658,24 @@ def set_boolean(self, location, key, value, wlst_value):
657658
self.set_attribute(location, key, result, wlst_merge_value=wlst_value, use_raw_value=True)
658659
return
659660

661+
def set_with_ssl_enabled(self, location, key, value, wlst_value):
662+
"""
663+
Set the specified attribute with SSL enabled in the current location.
664+
Restore SSL enabled status value after setting value.
665+
Currently, only Server/SSL/ListenPort offline has this requirement.
666+
:param location: the location
667+
:param key: the attribute name
668+
:param value: the new attribute value
669+
:param wlst_value: the existing value of the attribute from WLST
670+
:raises BundleAwareException of the specified type: if target is not found
671+
"""
672+
wlst_enabled_attribute = self.__aliases.get_wlst_attribute_name(location, ENABLED)
673+
was_enabled = self.__wlst_helper.get(wlst_enabled_attribute)
674+
self.set_attribute(location, ENABLED, True)
675+
self.set_attribute(location, key, value, wlst_merge_value=wlst_value)
676+
self.set_attribute(location, ENABLED, was_enabled)
677+
return
678+
660679
#
661680
# public set_attribute convenience methods
662681
#

core/src/main/python/wlsdeploy/tool/util/topology_helper.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2021, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 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

@@ -13,7 +13,6 @@
1313
from wlsdeploy.aliases.model_constants import CUSTOM_IDENTITY_KEYSTORE_FILE
1414
from wlsdeploy.aliases.model_constants import JDBC_RESOURCE
1515
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
16-
from wlsdeploy.aliases.model_constants import MIGRATABLE_TARGET
1716
from wlsdeploy.aliases.model_constants import NM_PROPERTIES
1817
from wlsdeploy.aliases.model_constants import SERVER
1918
from wlsdeploy.aliases.model_constants import SERVER_TEMPLATE
@@ -175,32 +174,6 @@ def clear_jdbc_placeholder_targeting(self, jdbc_names):
175174
mbean = self.wlst_helper.get_mbean_for_wlst_path(wlst_path)
176175
mbean.setTargets(None)
177176

178-
def remove_deleted_clusters_and_servers(self, domain_location, model_topology):
179-
"""
180-
Remove clusters, servers, server templates, and migratable targets that were flagged for deletion
181-
in the model. The deletions are intentionally skipped when these elements are first created.
182-
:param domain_location: the location for the root of the domain
183-
:param model_topology: the topology folder from the model
184-
"""
185-
_method_name = 'remove_deleted_clusters_and_servers'
186-
self.logger.entering(str(domain_location), class_name=self.__class_name, method_name=_method_name)
187-
188-
folder_names = [CLUSTER, SERVER]
189-
if self.wl_helper.is_weblogic_version_or_above('12.1.2'):
190-
folder_names.append(SERVER_TEMPLATE)
191-
if self.wl_helper.is_weblogic_version_or_above('12.1.3'):
192-
folder_names.append(MIGRATABLE_TARGET)
193-
for folder_name in folder_names:
194-
location = LocationContext(domain_location).append_location(folder_name)
195-
existing_names = deployer_utils.get_existing_object_list(location, self.aliases)
196-
folder_nodes = dictionary_utils.get_dictionary_element(model_topology, folder_name)
197-
198-
for mbean_name in folder_nodes:
199-
if model_helper.is_delete_name(mbean_name):
200-
deployer_utils.delete_named_element(location, mbean_name, existing_names, self.aliases)
201-
202-
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
203-
204177
def qualify_nm_properties(self, type_name, model_nodes, base_location, model_context, attribute_setter):
205178
"""
206179
For the NM properties MBean, update the keystore file path to be fully qualified with the domain directory.

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/Server.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"copyright": "Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates.",
2+
"copyright": "Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"wlst_type": "Server${:s}",
55
"child_folders_type": "multiple",
@@ -1063,7 +1063,7 @@
10631063
{"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "JSSEEnabled", "wlst_path": "WP001", "value": {"default": "true" }, "wlst_type": "boolean", "get_method": "LSA", "restart_required": "true" } ],
10641064
"KeyEncrypted": [ {"version": "[10,12.2.1)", "wlst_mode": "offline", "wlst_name": "KeyEncrypted", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean", "get_method": "LSA", "restart_required": "true" } ,
10651065
{"version": "[10,)", "wlst_mode": "online", "wlst_name": "KeyEncrypted", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean", "get_method": "GET", "restart_required": "true" } ],
1066-
"ListenPort": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ListenPort", "wlst_path": "WP001", "value": {"default": 7002 }, "wlst_type": "integer", "get_method": "LSA"} ],
1066+
"ListenPort": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ListenPort", "wlst_path": "WP001", "value": {"default": 7002 }, "wlst_type": "integer", "get_method": "LSA", "set_method": "${MBEAN.set_with_ssl_enabled:}"} ],
10671067
"LoginTimeoutMillis": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LoginTimeoutMillis", "wlst_path": "WP001", "value": {"default": 25000 }, "wlst_type": "integer" } ],
10681068
"MinimumTlsProtocolVersion": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "Minimum${Tls:TLS}ProtocolVersion", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
10691069
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],

0 commit comments

Comments
 (0)