diff --git a/manifests/domain.pp b/manifests/domain.pp index 7a7443be..2b831372 100644 --- a/manifests/domain.pp +++ b/manifests/domain.pp @@ -3,56 +3,73 @@ # setup a new weblogic domain ## define orawls::domain ( - $version = hiera('wls_version' , 1111), # 1036|1111|1211|1212|1213|1221 - $weblogic_home_dir = hiera('wls_weblogic_home_dir'), # /opt/oracle/middleware11gR1/wlserver_103 - $middleware_home_dir = hiera('wls_middleware_home_dir'), # /opt/oracle/middleware11gR1 - $jdk_home_dir = hiera('wls_jdk_home_dir'), # /usr/java/jdk1.7.0_45 - $wls_domains_dir = hiera('wls_domains_dir' , undef), - $wls_apps_dir = hiera('wls_apps_dir' , undef), - $domain_template = hiera('domain_template' , 'standard'), # adf|adf_restricted|osb|osb_soa_bpm|osb_soa|soa|soa_bpm|bam|wc|wc_wcc_bpm|oud - $bam_enabled = true, #only for SOA Suite - $b2b_enabled = false, #only for SOA Suite 12.1.3 with b2b - $ess_enabled = false, #only for SOA Suite 12.1.3 - $owsm_enabled = false, #only for OSB domain_template on 10.3.6 - $domain_name = hiera('domain_name'), - $development_mode = true, - $adminserver_name = hiera('domain_adminserver' , 'AdminServer'), - $adminserver_machine_name = hiera('domain_adminserver_machine_name', 'LocalMachine'), - $adminserver_address = hiera('domain_adminserver_address' , undef), - $adminserver_port = hiera('domain_adminserver_port' , 7001), - $adminserver_ssl_port = undef, - $adminserver_listen_on_all_interfaces = false, # for docker etc - $java_arguments = hiera('domain_java_arguments' , {}), # java_arguments = { "ADM" => "...", "OSB" => "...", "SOA" => "...", "BAM" => "..."} - $nodemanager_address = undef, - $nodemanager_port = hiera('domain_nodemanager_port' , 5556), - $nodemanager_secure_listener = true, - $weblogic_user = hiera('wls_weblogic_user' , 'weblogic'), - $weblogic_password = hiera('domain_wls_password'), - $nodemanager_username = undef, # When not specified, it'll use the weblogic_user - $nodemanager_password = undef, # When not specified, it'll use the weblogic_password - $domain_password = undef, # When not specified, it'll use the weblogic_password - $jsse_enabled = hiera('wls_jsse_enabled' , false), - $webtier_enabled = false, - $os_user = hiera('wls_os_user'), # oracle - $os_group = hiera('wls_os_group'), # dba - $download_dir = hiera('wls_download_dir'), # /data/install - $log_dir = hiera('wls_log_dir' , undef), # /data/logs - $log_output = false, # true|false - $repository_database_url = hiera('repository_database_url' , undef), #jdbc:oracle:thin:@192.168.50.5:1521:XE - $rcu_database_url = undef, #localhost:1521:XE" - $repository_prefix = hiera('repository_prefix' , 'DEV'), - $repository_password = hiera('repository_password' , 'Welcome01'), - $repository_sys_user = 'sys', - $repository_sys_password = undef, - $custom_trust = hiera('wls_custom_trust' , false), - $trust_keystore_file = hiera('wls_trust_keystore_file' , undef), - $trust_keystore_passphrase = hiera('wls_trust_keystore_passphrase' , undef), - $custom_identity = false, - $custom_identity_keystore_filename = undef, - $custom_identity_keystore_passphrase = undef, - $custom_identity_alias = undef, - $custom_identity_privatekey_passphrase = undef, - $create_rcu = hiera('create_rcu', true), + $version = hiera('wls_version' , 1111), # 1036|1111|1211|1212|1213|1221 + $weblogic_home_dir = hiera('wls_weblogic_home_dir'), # /opt/oracle/middleware11gR1/wlserver_103 + $middleware_home_dir = hiera('wls_middleware_home_dir'), # /opt/oracle/middleware11gR1 + $jdk_home_dir = hiera('wls_jdk_home_dir'), # /usr/java/jdk1.7.0_45 + $wls_domains_dir = hiera('wls_domains_dir' , undef), + $wls_apps_dir = hiera('wls_apps_dir' , undef), + $domain_template = hiera('domain_template' , 'standard'), # adf|adf_restricted|osb|osb_soa_bpm|osb_soa|soa|soa_bpm|bam|wc|wc_wcc_bpm|oud + $bam_enabled = true, #only for SOA Suite + $b2b_enabled = false, #only for SOA Suite 12.1.3 with b2b + $ess_enabled = false, #only for SOA Suite 12.1.3 + $owsm_enabled = false, #only for OSB domain_template on 10.3.6 + $domain_name = hiera('domain_name'), + $domain_log_filecount = 10, + $domain_log_rotationtype = 'byTime', + $domain_log_file_min_size = 5000, + $domain_log_file_timespan = 24, + $domain_log_number_of_files_limited = true, + $development_mode = true, + $adminserver_name = hiera('domain_adminserver' , 'AdminServer'), + $adminserver_machine_name = hiera('domain_adminserver_machine_name' , 'LocalMachine'), + $adminserver_address = hiera('domain_adminserver_address' , undef), + $adminserver_port = hiera('domain_adminserver_port' , 7001), + $adminserver_ssl_port = undef, + $adminserver_listen_on_all_interfaces = false, # for docker etc + $adminserver_log_filecount = 10, + $adminserver_log_file_min_size = 5000, + $adminserver_log_rotationtype = 'byTime', + $adminserver_log_file_timespan = 24, + $adminserver_log_number_of_files_limited = true, + $adminserver_log_redirect_stdout_to_server = false, + $adminserver_log_redirect_stderr_to_server = false, + $adminserver_log_http_filecount = 10, + $adminserver_log_http_file_min_size = 5000, + $adminserver_log_http_rotationtype = 'bySize', + $adminserver_log_http_file_timespan = 24, + $adminserver_log_http_number_of_files_limited = true, + $java_arguments = hiera('domain_java_arguments' , {}), # java_arguments = { "ADM" => "...", "OSB" => "...", "SOA" => "...", "BAM" => "..."} + $nodemanager_address = undef, + $nodemanager_port = hiera('domain_nodemanager_port' , 5556), + $nodemanager_secure_listener = true, + $weblogic_user = hiera('wls_weblogic_user' , 'weblogic'), + $weblogic_password = hiera('domain_wls_password'), + $nodemanager_username = undef, # When not specified, it'll use the weblogic_user + $nodemanager_password = undef, # When not specified, it'll use the weblogic_password + $domain_password = undef, # When not specified, it'll use the weblogic_password + $jsse_enabled = hiera('wls_jsse_enabled' , false), + $webtier_enabled = false, + $os_user = hiera('wls_os_user'), # oracle + $os_group = hiera('wls_os_group'), # dba + $download_dir = hiera('wls_download_dir'), # /data/install + $log_dir = hiera('wls_log_dir' , undef), # /data/logs + $log_output = false, # true|false + $repository_database_url = hiera('repository_database_url' , undef), #jdbc:oracle:thin:@192.168.50.5:1521:XE + $rcu_database_url = undef, #localhost:1521:XE" + $repository_prefix = hiera('repository_prefix' , 'DEV'), + $repository_password = hiera('repository_password' , 'Welcome01'), + $repository_sys_user = 'sys', + $repository_sys_password = undef, + $custom_trust = hiera('wls_custom_trust' , false), + $trust_keystore_file = hiera('wls_trust_keystore_file' , undef), + $trust_keystore_passphrase = hiera('wls_trust_keystore_passphrase' , undef), + $custom_identity = false, + $custom_identity_keystore_filename = undef, + $custom_identity_keystore_passphrase = undef, + $custom_identity_alias = undef, + $custom_identity_privatekey_passphrase = undef, + $create_rcu = hiera('create_rcu', true), ) { if ( $wls_domains_dir == undef or $wls_domains_dir == '' ) { diff --git a/templates/domains/domain.py.erb b/templates/domains/domain.py.erb index a686dc16..1496d43f 100644 --- a/templates/domains/domain.py.erb +++ b/templates/domains/domain.py.erb @@ -42,7 +42,7 @@ set_cross_domain() cd('/') print('Set domain log') -change_log('domain', DOMAIN, '<%= @admin_nodemanager_log_dir %>') +change_log('domain', DOMAIN, '<%= @admin_nodemanager_log_dir %>', <%= @domain_log_filecount %>, <%= @domain_log_file_min_size %>, '<%= @domain_log_rotationtype %>', <%= @domain_log_file_timespan %>, <%= @domain_log_number_of_files_limited %>) print('Create machine <%= @adminserver_machine_name %> with type UnixMachine') create_machine('UnixMachine', '<%= @adminserver_machine_name %>', '<%= @adminserver_address %>', NODEMANAGER_SECURE_LISTENER) @@ -59,7 +59,9 @@ if CUSTOM_IDENTITY_ENABLED == True: change_custom_identity_store(ADMIN_SERVER, '<%= @custom_identity_keystore_filename %>', '<%= @custom_identity_keystore_passphrase %>', '<%= @trust_keystore_file %>', '<%= @trust_keystore_passphrase %>', '<%= @custom_identity_alias %>', '<%= @custom_identity_privatekey_passphrase %>') print('Change AdminServer log') -change_log('server', ADMIN_SERVER, '<%= @admin_nodemanager_log_dir %>') +change_log('server', ADMIN_SERVER, '<%= @admin_nodemanager_log_dir %>', <%= @adminserver_log_filecount %>, <%= @adminserver_log_file_min_size %>, '<%= @adminserver_log_rotationtype %>', <%= @adminserver_log_file_timespan %>, <%= @adminserver_log_number_of_files_limited %>, <%= @adminserver_log_redirect_stdout_to_server %>, <%= @adminserver_log_redirect_stderr_to_server %>) +print('Change AdminServer webserverlog') +change_log('webserver', ADMIN_SERVER, '<%= @admin_nodemanager_log_dir %>', <%= @adminserver_log_http_filecount %>, <%= @adminserver_log_http_file_min_size %>, '<%= @adminserver_log_http_rotationtype %>', <%= @adminserver_log_http_file_timespan %>, <%= @adminserver_log_http_number_of_files_limited %> ) print('Set password...') set_weblogic_password(ADMIN_USER, ADMIN_PASSWORD) diff --git a/templates/domains/utils.py.erb b/templates/domains/utils.py.erb index 56af318c..b6af1685 100644 --- a/templates/domains/utils.py.erb +++ b/templates/domains/utils.py.erb @@ -103,21 +103,34 @@ def create_opss_datasource(target, prefix, password, db_url): cd('JDBCConnectionPoolParams/NO_NAME_0') set('TestTableName', 'SQL SELECT 1 FROM DUAL') -def change_log(wls_type, name, log_folder): +def change_log(wls_type, name, log_folder, log_filecount=None, log_file_min_size=None, log_rotationtype=None, log_file_timespan=None, log_number_of_files_limited=None, log_redirect_stdout_to_server=None, log_redirect_stderr_to_server=None): if wls_type == 'server': cd('/Server/' + name) create(name, 'Log') cd('/Server/' + name + '/Log/' + name) + set('FileName', log_folder + '/' + name + '.log') + set('RedirectStderrToServerLogEnabled', log_redirect_stderr_to_server) + set('RedirectStdoutToServerLogEnabled', log_redirect_stdout_to_server) + elif wls_type == 'webserver': + cd('/Server/' + name) + create(name, 'WebServer') + cd('/Server/'+name+'/WebServer/'+name) + create(name, 'WebServerLog') + cd('/Server/'+name+'/WebServer/'+name + '/WebServerLog/'+name) + set('FileName', log_folder + '/' + name + '-acces.log') else: cd('/') create('base_domain', 'Log') cd('/Log/base_domain') + set('FileName', log_folder + '/' + name + '.log') + + set('FileCount', log_filecount) + set('FileMinSize', log_file_min_size) + set('RotationType', log_rotationtype) + set('FileTimeSpan', log_file_timespan) + set('NumberOfFilesLimited', log_number_of_files_limited) + - set('FileName', log_folder + '/' + name + '.log') - set('FileCount', 10) - set('FileMinSize', 5000) - set('RotationType', 'byTime') - set('FileTimeSpan', 24) def change_ssl_with_port(server, jsse_enabled, ssl_listen_port): cd('/Server/' + server)