Skip to content

Re-deploy servers and clusters after initial domain creation #1036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/src/main/python/wlsdeploy/tool/create/domain_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
from wlsdeploy.aliases.model_constants import USER
from wlsdeploy.aliases.model_constants import VIRTUAL_TARGET
from wlsdeploy.aliases.model_constants import WLS_USER_PASSWORD_CREDENTIAL_MAPPINGS
from wlsdeploy.aliases.model_constants import WLS_DEFAULT_AUTHENTICATION
from wlsdeploy.aliases.model_constants import WS_RELIABLE_DELIVERY_POLICY
from wlsdeploy.aliases.model_constants import XML_ENTITY_CACHE
from wlsdeploy.aliases.model_constants import XML_REGISTRY
Expand Down Expand Up @@ -640,8 +639,9 @@ def __apply_base_domain_config(self, topology_folder_list):
self.__create_reliable_delivery_policy(location)
topology_folder_list.remove(WS_RELIABLE_DELIVERY_POLICY)

# these deletions were intentionally skipped when these elements are first created.
self.topology_helper.remove_deleted_clusters_and_servers(location, self._topology)
# this second pass will re-establish any attributes that were changed by templates,
# and process deletes and re-adds of named elements in the model order.
self.__create_machines_clusters_and_servers()
topology_folder_list.remove(MACHINE)
topology_folder_list.remove(UNIX_MACHINE)
topology_folder_list.remove(CLUSTER)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2017, 2021, Oracle and/or its affiliates.
Copyright (c) 2017, 2022, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
from wlsdeploy.aliases.location_context import LocationContext
Expand Down Expand Up @@ -96,8 +96,9 @@ def update(self):
self._process_section(self._topology, folder_list, ADMIN_CONSOLE, location)
self._process_section(self._topology, folder_list, CDI_CONTAINER, location)

# these deletions were intentionally skipped when these elements are first created.
self._topology_helper.remove_deleted_clusters_and_servers(location, self._topology)
# this second pass will re-establish any attributes that were changed by templates,
# and process deletes and re-adds of named elements in the model order.
self.update_machines_clusters_and_servers()
folder_list.remove(CLUSTER)
folder_list.remove(SERVER)
if SERVER_TEMPLATE in folder_list:
Expand Down
21 changes: 20 additions & 1 deletion core/src/main/python/wlsdeploy/tool/util/attribute_setter.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates. All rights reserved.
Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
from javax.management import ObjectName
Expand All @@ -16,6 +16,7 @@
from wlsdeploy.aliases.model_constants import CONTEXT_REQUEST_CLASS
from wlsdeploy.aliases.model_constants import DISTRIBUTED_QUEUE
from wlsdeploy.aliases.model_constants import DISTRIBUTED_TOPIC
from wlsdeploy.aliases.model_constants import ENABLED
from wlsdeploy.aliases.model_constants import FAIR_SHARE_REQUEST_CLASS
from wlsdeploy.aliases.model_constants import FILE_STORE
from wlsdeploy.aliases.model_constants import HEAP_DUMP_ACTION
Expand Down Expand Up @@ -657,6 +658,24 @@ def set_boolean(self, location, key, value, wlst_value):
self.set_attribute(location, key, result, wlst_merge_value=wlst_value, use_raw_value=True)
return

def set_with_ssl_enabled(self, location, key, value, wlst_value):
"""
Set the specified attribute with SSL enabled in the current location.
Restore SSL enabled status value after setting value.
Currently, only Server/SSL/ListenPort offline has this requirement.
:param location: the location
:param key: the attribute name
:param value: the new attribute value
:param wlst_value: the existing value of the attribute from WLST
:raises BundleAwareException of the specified type: if target is not found
"""
wlst_enabled_attribute = self.__aliases.get_wlst_attribute_name(location, ENABLED)
was_enabled = self.__wlst_helper.get(wlst_enabled_attribute)
self.set_attribute(location, ENABLED, True)
self.set_attribute(location, key, value, wlst_merge_value=wlst_value)
self.set_attribute(location, ENABLED, was_enabled)
return

#
# public set_attribute convenience methods
#
Expand Down
29 changes: 1 addition & 28 deletions core/src/main/python/wlsdeploy/tool/util/topology_helper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Copyright (c) 2017, 2021, Oracle and/or its affiliates.
Copyright (c) 2017, 2022, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""

Expand All @@ -13,7 +13,6 @@
from wlsdeploy.aliases.model_constants import CUSTOM_IDENTITY_KEYSTORE_FILE
from wlsdeploy.aliases.model_constants import JDBC_RESOURCE
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
from wlsdeploy.aliases.model_constants import MIGRATABLE_TARGET
from wlsdeploy.aliases.model_constants import NM_PROPERTIES
from wlsdeploy.aliases.model_constants import SERVER
from wlsdeploy.aliases.model_constants import SERVER_TEMPLATE
Expand Down Expand Up @@ -175,32 +174,6 @@ def clear_jdbc_placeholder_targeting(self, jdbc_names):
mbean = self.wlst_helper.get_mbean_for_wlst_path(wlst_path)
mbean.setTargets(None)

def remove_deleted_clusters_and_servers(self, domain_location, model_topology):
"""
Remove clusters, servers, server templates, and migratable targets that were flagged for deletion
in the model. The deletions are intentionally skipped when these elements are first created.
:param domain_location: the location for the root of the domain
:param model_topology: the topology folder from the model
"""
_method_name = 'remove_deleted_clusters_and_servers'
self.logger.entering(str(domain_location), class_name=self.__class_name, method_name=_method_name)

folder_names = [CLUSTER, SERVER]
if self.wl_helper.is_weblogic_version_or_above('12.1.2'):
folder_names.append(SERVER_TEMPLATE)
if self.wl_helper.is_weblogic_version_or_above('12.1.3'):
folder_names.append(MIGRATABLE_TARGET)
for folder_name in folder_names:
location = LocationContext(domain_location).append_location(folder_name)
existing_names = deployer_utils.get_existing_object_list(location, self.aliases)
folder_nodes = dictionary_utils.get_dictionary_element(model_topology, folder_name)

for mbean_name in folder_nodes:
if model_helper.is_delete_name(mbean_name):
deployer_utils.delete_named_element(location, mbean_name, existing_names, self.aliases)

self.logger.exiting(class_name=self.__class_name, method_name=_method_name)

def qualify_nm_properties(self, type_name, model_nodes, base_location, model_context, attribute_setter):
"""
For the NM properties MBean, update the keystore file path to be fully qualified with the domain directory.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"copyright": "Copyright (c) 2017, 2020, Oracle Corporation and/or its affiliates.",
"copyright": "Copyright (c) 2017, 2022, Oracle Corporation and/or its affiliates.",
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
"wlst_type": "Server${:s}",
"child_folders_type": "multiple",
Expand Down Expand Up @@ -1063,7 +1063,7 @@
{"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" } ],
"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" } ,
{"version": "[10,)", "wlst_mode": "online", "wlst_name": "KeyEncrypted", "wlst_path": "WP001", "value": {"default": "false" }, "wlst_type": "boolean", "get_method": "GET", "restart_required": "true" } ],
"ListenPort": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ListenPort", "wlst_path": "WP001", "value": {"default": 7002 }, "wlst_type": "integer", "get_method": "LSA"} ],
"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:}"} ],
"LoginTimeoutMillis": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "LoginTimeoutMillis", "wlst_path": "WP001", "value": {"default": 25000 }, "wlst_type": "integer" } ],
"MinimumTlsProtocolVersion": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "Minimum${Tls:TLS}ProtocolVersion", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
Expand Down