def update(self): """ Deploy resource model elements at the domain level, including multi-tenant elements. """ domain_token = deployer_utils.get_domain_token(self.alias_helper) location = LocationContext() location.add_name_token(domain_token, self.model_context.get_domain_name()) # create a list, then remove each element as it is processed folder_list = self.alias_helper.get_model_topology_top_level_folder_names( ) # /Security cannot be updated on existing domain folder_list.remove(SECURITY) self._security_provider_creator.create_security_configuration(location) folder_list.remove(SECURITY_CONFIGURATION) # set the domain attributes self._set_domain_attributes() self._process_section(self._topology, folder_list, MACHINE, location) self._process_section(self._topology, folder_list, UNIX_MACHINE, location) # avoid circular references between clusters and server templates self._topology_helper.create_placeholder_server_templates( self._topology) # create placeholders for JDBC resources that may be referenced in cluster definition. self._topology_helper.create_placeholder_jdbc_resources( self._resources) self._process_section(self._topology, folder_list, CLUSTER, location) self._process_section(self._topology, folder_list, SERVER_TEMPLATE, location) self._process_section(self._topology, folder_list, SERVER, location) self._process_section(self._topology, folder_list, MIGRATABLE_TARGET, location) # process remaining top-level folders. copy list to avoid concurrent update in loop remaining = list(folder_list) for folder_name in remaining: self._process_section(self._topology, folder_list, folder_name, location) server_groups_to_target = self._domain_typedef.get_server_groups_to_target( ) self.target_helper.target_server_groups_to_servers( server_groups_to_target) # files referenced in attributes are extracted as attributes are processed self.library_helper.install_domain_libraries() self.library_helper.extract_classpath_libraries()
def deploy_after_update(self, location): """ Deploy resource model elements that must be done after WLST updateDomain. :param location: the location to deploy elements (includes basic tokens) """ domain_token = deployer_utils.get_domain_token(self.alias_helper) location.add_name_token(domain_token, self.model_context.get_domain_name()) odl_deployer = OdlDeployer(self.model, self.model_context, self.aliases, self.wlst_mode) odl_deployer.configure_odl(self._resources, location)
def deploy(self, location): """ Deploy resource model elements at the domain level, including multi-tenant elements. :param location: the location to deploy elements (includes basic tokens) """ domain_token = deployer_utils.get_domain_token(self.alias_helper) location.add_name_token(domain_token, self.model_context.get_domain_name()) self._add_resources(location) multi_tenant_deployer = \ MultiTenantResourcesDeployer(self.model, self.model_context, self.aliases, self.wlst_mode) multi_tenant_deployer.add_multi_tenant_objects(location)
def update_machines_clusters_and_servers(self, delete_now=True): """ Update the main topology components, the components that are used as targets for other resources. :param delete_now: Flag to determine whether to delay the delete. """ domain_token = deployer_utils.get_domain_token(self.aliases) location = LocationContext() location.add_name_token(domain_token, self.model_context.get_domain_name()) folder_list = list() folder_list.append(CLUSTER) folder_list.append(SERVER) folder_list.append(SERVER_TEMPLATE) folder_list.append(MIGRATABLE_TARGET) folder_list.append(MACHINE) folder_list.append(UNIX_MACHINE) self._process_section(self._topology, folder_list, MACHINE, location) self._process_section(self._topology, folder_list, UNIX_MACHINE, location) # avoid circular references between clusters and server templates self._topology_helper.create_placeholder_server_templates( self._topology) # create placeholders for JDBC resources that may be referenced in cluster definition. jdbc_names = self._topology_helper.create_placeholder_jdbc_resources( self._resources) self._process_section(self._topology, folder_list, CLUSTER, location, delete_now) self._process_section(self._topology, folder_list, SERVER_TEMPLATE, location, delete_now) # create placeholders for Servers that are in a cluster as /Server/JTAMigratableTarget # can reference "other" servers self._topology_helper.create_placeholder_servers_in_cluster( self._topology) self._process_section(self._topology, folder_list, SERVER, location, delete_now) self._process_section(self._topology, folder_list, MIGRATABLE_TARGET, location, delete_now) # targets may have been inadvertently assigned when clusters were added self.topology_helper.clear_jdbc_placeholder_targeting(jdbc_names)
def update(self): """ Deploy resource model elements at the domain level, including multi-tenant elements. """ domain_token = deployer_utils.get_domain_token(self.aliases) location = LocationContext() location.add_name_token(domain_token, self.model_context.get_domain_name()) # create a list, then remove each element as it is processed folder_list = self.aliases.get_model_topology_top_level_folder_names() # /Security cannot be updated on existing domain folder_list.remove(SECURITY) self._security_provider_creator.create_security_configuration(location) folder_list.remove(SECURITY_CONFIGURATION) # set the domain attributes self._set_domain_attributes() self._process_section(self._topology, folder_list, ADMIN_CONSOLE, location) self._process_section(self._topology, folder_list, CDI_CONTAINER, location) self.update_machines_clusters_and_servers() folder_list.remove(CLUSTER) folder_list.remove(SERVER) folder_list.remove(SERVER_TEMPLATE) folder_list.remove(MIGRATABLE_TARGET) # process remaining top-level folders. copy list to avoid concurrent update in loop remaining = list(folder_list) for folder_name in remaining: self._process_section(self._topology, folder_list, folder_name, location) self.library_helper.install_domain_libraries() self.library_helper.extract_classpath_libraries() self.library_helper.install_domain_scripts()
def _configure_security_configuration(self): """ Configure the SecurityConfiguration MBean and its Realm sub-folder. In 11g, the SecurityConfiguration MBean is not persisted to the domain config until the domain is first written. :return: """ _method_name = '_configure_security_configuration' self.logger.entering(class_name=self.__class_name, method_name=_method_name) # SecurityConfiguration is special since the subfolder name does not change when you change the domain name. # It only changes once the domain is written and re-read... location = LocationContext() domain_name_token = deployer_utils.get_domain_token(self.alias_helper) security_config_location = LocationContext().add_name_token( domain_name_token, self._domain_name) self.security_provider_creator.create_security_configuration( security_config_location) self.logger.exiting(class_name=self.__class_name, method_name=_method_name) return
def update(self): """ Deploy resource model elements at the domain level, including multi-tenant elements. """ # For issue in setServerGroups in online mode (new configured clusters and stand-alone managed servers # will not have extension template resources targeted) existing_managed_servers, existing_configured_clusters = self._create_list_of_setservergroups_targets( ) domain_token = deployer_utils.get_domain_token(self.alias_helper) location = LocationContext() location.add_name_token(domain_token, self.model_context.get_domain_name()) # create a list, then remove each element as it is processed folder_list = self.alias_helper.get_model_topology_top_level_folder_names( ) # /Security cannot be updated on existing domain folder_list.remove(SECURITY) self._security_provider_creator.create_security_configuration(location) folder_list.remove(SECURITY_CONFIGURATION) # set the domain attributes self._set_domain_attributes() self._process_section(self._topology, folder_list, ADMIN_CONSOLE, location) self._process_section(self._topology, folder_list, MACHINE, location) self._process_section(self._topology, folder_list, UNIX_MACHINE, location) # avoid circular references between clusters and server templates self._topology_helper.create_placeholder_server_templates( self._topology) # create placeholders for JDBC resources that may be referenced in cluster definition. self._topology_helper.create_placeholder_jdbc_resources( self._resources) self._process_section(self._topology, folder_list, CLUSTER, location) self._process_section(self._topology, folder_list, SERVER_TEMPLATE, location) # create placeholders for Servers that are in a cluster as /Server/JTAMigratableTarget # can reference "other" servers self._topology_helper.create_placeholder_servers_in_cluster( self._topology) self._process_section(self._topology, folder_list, SERVER, location) self._process_section(self._topology, folder_list, MIGRATABLE_TARGET, location) new_managed_server_list, new_configured_cluster_list = self._create_list_of_setservergroups_targets( ) self._check_for_online_setservergroups_issue(existing_managed_servers, new_managed_server_list) self._check_for_online_setservergroups_issue( existing_configured_clusters, new_configured_cluster_list) # process remaining top-level folders. copy list to avoid concurrent update in loop remaining = list(folder_list) for folder_name in remaining: self._process_section(self._topology, folder_list, folder_name, location) if self.wls_helper.is_set_server_groups_supported(): server_groups_to_target = self._domain_typedef.get_server_groups_to_target( ) server_assigns, dynamic_assigns = \ self.target_helper.target_server_groups_to_servers(server_groups_to_target) if len(dynamic_assigns) > 0: self.wlst_helper.save_and_close(self.model_context) self.target_helper.target_server_groups_to_dynamic_clusters( dynamic_assigns) self.wlst_helper.reopen(self.model_context) if len(server_assigns) > 0: self.target_helper.target_server_groups(server_assigns) elif self._domain_typedef.is_jrf_domain_type(): self.target_helper.target_jrf_groups_to_clusters_servers() self.library_helper.install_domain_libraries() self.library_helper.extract_classpath_libraries()