From ec85b184ff8750b2d70ed27197461c0c3115f3bf Mon Sep 17 00:00:00 2001 From: Jarkko Oranen Date: Tue, 13 Apr 2021 19:18:42 +0300 Subject: [PATCH] Refactor database configuration and make the main API typed (#352) Unify dbconfig.xml across databases and use JIRA's built-in defaults when not overridden by user This removes the use_connection_pooling parameter since for most databases, it does nothing useful. The poolsize parameter is also deprecated, and is just an alias for pool_max_size now It also sets the default values for most parameters to "undef" and omits them from the configuration if the user doesn't override them. The previous module defaults mostly match JIRA's built-in ones anyway. While here, add types to the main API; some things which accepted integer-looking strings previously will now require actual integers, but otherwise nothing changes. --- README.md | 38 +++---- examples/jira_mysql_install.pp | 2 +- examples/jira_mysql_nativessl_install.pp | 2 +- examples/jira_postgres_install.pp | 2 +- examples/jira_postgres_nginx_install.pp | 4 +- examples/jira_postgres_nginx_ssl_install.pp | 4 +- jira.yaml | 8 +- manifests/config.pp | 25 ++--- manifests/init.pp | 117 +++++++++++--------- spec/acceptance/mysql_spec.rb | 4 +- spec/classes/jira_config_spec.rb | 30 ++--- templates/dbconfig.h2.xml.erb | 23 ---- templates/dbconfig.mysql.xml.erb | 26 ----- templates/dbconfig.oracle.xml.erb | 24 ---- templates/dbconfig.postgresql.xml.erb | 28 ----- templates/dbconfig.sqlserver.xml.erb | 25 ----- templates/dbconfig.xml.epp | 54 +++++++++ 17 files changed, 169 insertions(+), 247 deletions(-) delete mode 100644 templates/dbconfig.h2.xml.erb delete mode 100644 templates/dbconfig.mysql.xml.erb delete mode 100644 templates/dbconfig.oracle.xml.erb delete mode 100644 templates/dbconfig.postgresql.xml.erb delete mode 100644 templates/dbconfig.sqlserver.xml.erb create mode 100644 templates/dbconfig.xml.epp diff --git a/README.md b/README.md index d222a49c..e3196dad 100644 --- a/README.md +++ b/README.md @@ -270,64 +270,59 @@ NOTE: Atlassian only supports Oracle 11g/12g, even so this value should be as do Set the schema -The Default value is 'public' - -##### `$poolsize` - -The connection pool size to the database, defaults to 20 +The default value is 'public' for PostgreSQL, and undef for others ##### `$dburl` This parameter is not required nor do we recommend setting it. However it can be used to customize the database connection string. -##### `$enable_connection_pooling` +##### `$pool_max_size` -Configure database settings if you are pooling connections, defaults to 'false' +Setting most of the advanced JDBC parameters is not required unless you want to tune JIRA +settings. -##### `$pool_min_size` +defaults to undef -defaults to 20 (requires `enable_connection_pooling => true`) - -##### `$pool_max_size` +##### `$pool_min_size` -defaults to 20 (requires `enable_connection_pooling => true`) +defaults to undef ##### `$pool_max_wait` -defaults to 30000 (requires `enable_connection_pooling => true`) +defaults to undef ##### `$validation_query` -defaults to undef (requires `enable_connection_pooling => true`) +defaults to undef ##### `$min_evictable_idle_time` -defaults to 60000 (requires `enable_connection_pooling => true`) +defaults to undef ##### `$time_between_eviction_runs` -defaults to undef (requires `enable_connection_pooling => true`) +defaults to undef ##### `$pool_max_idle` -defaults to 20 (requires `enable_connection_pooling => true`) +defaults to undef ##### `$pool_remove_abandoned` -defaults to true (requires `enable_connection_pooling => true`) +defaults to undef ##### `$pool_remove_abandoned_timeout` -defaults to 300 (requires `enable_connection_pooling => true`) +defaults to undef ##### `$pool_test_while_idle` -defaults to true (requires `enable_connection_pooling => true`) +defaults to undef ##### `$pool_test_on_borrow` -defaults to false (requires `enable_connection_pooling => true`) +defaults to undef #### MySQL Java Connector parameters @@ -666,7 +661,6 @@ jira::jvm_xms: '1G' jira::jvm_xmx: '3G' jira::jvm_permgen: '384m' jira::service_manage: false -jira::enable_connection_pooling: 'true' jira::env: - 'http_proxy=proxy.example.co.za:8080' - 'https_proxy=proxy.example.co.za:8080' diff --git a/examples/jira_mysql_install.pp b/examples/jira_mysql_install.pp index 78263b35..d06ec78a 100644 --- a/examples/jira_mysql_install.pp +++ b/examples/jira_mysql_install.pp @@ -13,7 +13,7 @@ -> class { 'jira': javahome => '/opt/java/latest', db => 'mysql', - dbport => '3306', + dbport => 3306, dbdriver => 'com.mysql.jdbc.Driver', dbtype => 'mysql', } diff --git a/examples/jira_mysql_nativessl_install.pp b/examples/jira_mysql_nativessl_install.pp index b0fd7cf0..d6b8943c 100644 --- a/examples/jira_mysql_nativessl_install.pp +++ b/examples/jira_mysql_nativessl_install.pp @@ -30,7 +30,7 @@ } java_ks { 'jira': - ensure => present, + ensure => 'present', name => 'jira', certificate => '/etc/ssl/jira_cert.pem', private_key => '/etc/ssl/jira_key.pem', diff --git a/examples/jira_postgres_install.pp b/examples/jira_postgres_install.pp index c204af59..fe011db8 100644 --- a/examples/jira_postgres_install.pp +++ b/examples/jira_postgres_install.pp @@ -1,7 +1,7 @@ node default { class { 'postgresql::globals': manage_package_repo => true, - version => '9.3', + version => '11', } -> class { 'postgresql::server': } diff --git a/examples/jira_postgres_nginx_install.pp b/examples/jira_postgres_nginx_install.pp index ef4019e0..c4ea65c4 100644 --- a/examples/jira_postgres_nginx_install.pp +++ b/examples/jira_postgres_nginx_install.pp @@ -3,7 +3,7 @@ -> class { 'postgresql::globals': manage_package_repo => true, - version => '9.3', + version => '11', } -> class { 'postgresql::server': } @@ -18,7 +18,7 @@ proxy => { scheme => 'http', proxyName => $facts['networking']['fqdn'], - proxyPort => '80', + proxyPort => 80, }, } diff --git a/examples/jira_postgres_nginx_ssl_install.pp b/examples/jira_postgres_nginx_ssl_install.pp index f95207f8..472ddddc 100644 --- a/examples/jira_postgres_nginx_ssl_install.pp +++ b/examples/jira_postgres_nginx_ssl_install.pp @@ -3,7 +3,7 @@ -> class { 'postgresql::globals': manage_package_repo => true, - version => '9.3', + version => '11', } -> class { 'postgresql::server': } @@ -18,7 +18,7 @@ proxy => { scheme => 'https', proxyName => $facts['networking']['fqdn'], - proxyPort => '443', + proxyPort => 443, }, } diff --git a/jira.yaml b/jira.yaml index ab020a0b..47931d78 100644 --- a/jira.yaml +++ b/jira.yaml @@ -65,9 +65,7 @@ jira::dbschema: 'public' # Default for mssql #jira::dbschema: 'dbo' -# The connection pool size -jira::poolsize: 20 -jira::enable_connection_pooling: false +# The connection pool parameters jira::pool_min_size: 20 jira::pool_max_size: 20 jira::pool_max_wait: 30000 @@ -102,8 +100,8 @@ jira::service_ensure: running jira::service_enable: true # Tomcat settings -jira::tomcat_max_threads: '150' -jira::tomcat_accept_count: '100' +jira::tomcat_max_threads: 150 +jira::tomcat_accept_count: 100 # Configure reverse ssl proxy jira::proxy: diff --git a/manifests/config.pp b/manifests/config.pp index 18de0ac4..ebc676fb 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -19,25 +19,14 @@ group => $jira::group, } - if $jira::validation_query == undef { - $validation_query = $jira::db ? { - 'postgresql' => 'select version();', - 'mysql' => 'select 1', - 'oracle' => 'select 1 from dual', - 'sqlserver' => 'select 1', - 'h2' => 'select 1', - } - } - if $jira::time_between_eviction_runs == undef { - $time_between_eviction_runs = $jira::db ? { - 'postgresql' => '30000', - 'mysql' => '300000', - 'oracle' => '300000', - 'sqlserver' => '300000', - 'h2' => '5000', - } + $dbschema_default = $jira::db ? { + 'postgresql' => 'public', + default => undef } + # can't use pick_default: https://tickets.puppetlabs.com/browse/MODULES-11018 + $dbschema = if $jira::dbschema { $jira::dbschema } else { $dbschema_default } + file { "${jira::webappdir}/bin/user.sh": content => template('jira/user.sh.erb'), mode => '0755', @@ -56,7 +45,7 @@ } -> file { "${jira::homedir}/dbconfig.xml": - content => template("jira/dbconfig.${jira::db}.xml.erb"), + content => epp('jira/dbconfig.xml.epp'), mode => '0600', require => [Class['jira::install'],File[$jira::homedir]], notify => Class['jira::service'], diff --git a/manifests/init.pp b/manifests/init.pp index a74db41e..83c19998 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -41,29 +41,28 @@ Boolean $manage_user = true, String $user = 'jira', String $group = 'jira', - $uid = undef, - $gid = undef, + Optional[Integer[0]] $uid = undef, + Optional[Integer[0]] $gid = undef, Stdlib::Absolutepath $shell = '/bin/true', # Advanced configuration options Boolean $enable_secure_admin_sessions = true, Hash $jira_config_properties = {}, Boolean $datacenter = false, - $shared_homedir = undef, + Optional[Stdlib::AbsolutePath] $shared_homedir = undef, Optional[Stdlib::Host] $ehcache_listener_host = undef, Optional[Stdlib::Port] $ehcache_listener_port = undef, Optional[Stdlib::Port] $ehcache_object_port = undef, # Database Settings Enum['postgresql','mysql','sqlserver','oracle','h2'] $db = 'postgresql', - $dbuser = 'jiraadm', - $dbpassword = 'mypassword', - $dbserver = 'localhost', - $dbname = 'jira', + String $dbuser = 'jiraadm', + String $dbpassword = 'mypassword', + String $dbserver = 'localhost', + String $dbname = 'jira', Optional[Variant[Integer,String]] $dbport = undef, Optional[String] $dbdriver = undef, Optional[String] $dbtype = undef, Optional[String] $dburl = undef, - $poolsize = '20', - $dbschema = 'public', + $dbschema = undef, # MySQL Connector Settings $mysql_connector_manage = true, $mysql_connector_version = '5.1.34', @@ -71,21 +70,20 @@ $mysql_connector_format = 'tar.gz', Stdlib::Absolutepath $mysql_connector_install = '/opt/MySQL-connector', Stdlib::HTTPUrl $mysql_connector_url = 'https://dev.mysql.com/get/Downloads/Connector-J', - # Configure database settings if you are pooling connections - $enable_connection_pooling = false, - $pool_min_size = 20, - $pool_max_size = 20, - $pool_max_wait = 30000, - $validation_query = undef, - $min_evictable_idle_time = 60000, - $time_between_eviction_runs = undef, - $pool_max_idle = 20, - $pool_remove_abandoned = true, - $pool_remove_abandoned_timeout = 300, - $pool_test_while_idle = true, - $pool_test_on_borrow = false, + Optional[Integer[0]] $pool_min_size = undef, + Optional[Integer[0]] $pool_max_size = undef, + Optional[Integer[-1]] $pool_max_wait = undef, + Optional[String] $validation_query = undef, + Optional[Integer[0]] $validation_query_timeout = undef, + Optional[Integer[0]] $min_evictable_idle_time = undef, + Optional[Integer[0]] $time_between_eviction_runs = undef, + Optional[Integer[0]] $pool_max_idle = undef, + Optional[Boolean] $pool_remove_abandoned = undef, + Optional[Integer[0]] $pool_remove_abandoned_timeout = undef, + Optional[Boolean] $pool_test_while_idle = undef, + Optional[Boolean] $pool_test_on_borrow = undef, # JVM Settings - $javahome = undef, + Optional[Stdlib::AbsolutePath] $javahome = undef, Jira::Jvm_types $jvm_type = 'openjdk-11', String $jvm_xms = '256m', String $jvm_xmx = '1024m', @@ -95,54 +93,53 @@ Optional[String] $jvm_gc_args = undef, Optional[String] $jvm_codecache_args = undef, Integer $jvm_nofiles_limit = 16384, - Optional[String] $java_opts = undef, String $catalina_opts = '', # Misc Settings Stdlib::HTTPUrl $download_url = 'https://product-downloads.atlassian.com/software/jira/downloads', - $checksum = undef, - $disable_notifications = false, + Optional[String] $checksum = undef, + Boolean $disable_notifications = false, # Choose whether to use puppet-staging, or puppet-archive $deploy_module = 'archive', - $proxy_server = undef, + Optional[String] $proxy_server = undef, Optional[Enum['none','http','https','ftp']] $proxy_type = undef, # Manage service - $service_manage = true, - $service_ensure = running, - $service_enable = true, + Boolean $service_manage = true, + Stdlib::Ensure::Service $service_ensure = 'running', + Boolean $service_enable = true, $service_notify = undef, $service_subscribe = undef, # Command to stop jira in preparation to updgrade. This is configurable # incase the jira service is managed outside of puppet. eg: using the # puppetlabs-corosync module: 'crm resource stop jira && sleep 15' - $stop_jira = 'service jira stop && sleep 15', + String $stop_jira = 'service jira stop && sleep 15', # Whether to manage the 'check-java.sh' script, and where to retrieve # the script from. - $script_check_java_manage = false, - $script_check_java_template = 'jira/check-java.sh.erb', + Boolean $script_check_java_manage = false, + String $script_check_java_template = 'jira/check-java.sh.erb', # Tomcat - $tomcat_address = undef, - $tomcat_port = 8080, - $tomcat_shutdown_port = 8005, - $tomcat_max_http_header_size = '8192', - $tomcat_min_spare_threads = '25', - $tomcat_connection_timeout = '20000', - $tomcat_enable_lookups = false, - $tomcat_native_ssl = false, - $tomcat_https_port = 8443, - Optional[Integer] $tomcat_redirect_https_port = undef, - $tomcat_protocol = 'HTTP/1.1', - $tomcat_protocol_ssl = undef, - $tomcat_use_body_encoding_for_uri = true, - $tomcat_disable_upload_timeout = true, - $tomcat_key_alias = 'jira', + Optional[String] $tomcat_address = undef, + Stdlib::Port $tomcat_port = 8080, + Stdlib::Port $tomcat_shutdown_port = 8005, + Integer $tomcat_max_http_header_size = 8192, + Integer[0] $tomcat_min_spare_threads = 25, + Integer[0] $tomcat_connection_timeout = 20000, + Boolean $tomcat_enable_lookups = false, + Boolean $tomcat_native_ssl = false, + Stdlib::Port $tomcat_https_port = 8443, + Optional[Stdlib::Port] $tomcat_redirect_https_port = undef, + String $tomcat_protocol = 'HTTP/1.1', + Optional[String] $tomcat_protocol_ssl = undef, + Boolean $tomcat_use_body_encoding_for_uri = true, + Boolean $tomcat_disable_upload_timeout = true, + String $tomcat_key_alias = 'jira', Stdlib::Absolutepath $tomcat_keystore_file = '/home/jira/jira.jks', - $tomcat_keystore_pass = 'changeit', + String $tomcat_keystore_pass = 'changeit', Enum['JKS', 'JCEKS', 'PKCS12'] $tomcat_keystore_type = 'JKS', - $tomcat_accesslog_format = '%a %{jira.request.id}r %{jira.request.username}r %t "%m %U%q %H" %s %b %D "%{Referer}i" "%{User-Agent}i" "%{jira.request.assession.id}r"', + String $tomcat_accesslog_format = '%a %{jira.request.id}r %{jira.request.username}r %t "%m %U%q %H" %s %b %D "%{Referer}i" "%{User-Agent}i" "%{jira.request.assession.id}r"', Boolean $tomcat_accesslog_enable_xforwarded_for = false, # Tomcat Tunables - $tomcat_max_threads = '150', - $tomcat_accept_count = '100', + Integer $tomcat_max_threads = 150, + Integer $tomcat_accept_count = 100, # Reverse https proxy Hash $proxy = {}, # Options for the AJP connector @@ -164,11 +161,19 @@ String $session_tokenkey = 'session.tokenkey', Integer $session_validationinterval = 5, String $session_lastvalidation = 'session.lastvalidation', + # Deprecated parameters + Optional[Integer[0]] $poolsize = undef, + Optional[String] $java_opts = undef, + Optional[Boolean] $enable_connection_pooling = undef, ) inherits jira::params { if $datacenter and !$shared_homedir { fail("\$shared_homedir must be set when \$datacenter is true") } + if $enable_connection_pooling != undef { + deprecation('jira::enable_connection_pooling', 'jira::enable_connection_pooling has been removed and does nothing. Please simply configure the connection pooling parameters') + } + if $java_opts { deprecation('jira::java_opts', 'jira::java_opts is deprecated. Please use jira::jvm_extra_args') $jvm_extra_args_real = "${java_opts} ${jvm_extra_args}" @@ -176,6 +181,14 @@ $jvm_extra_args_real = $jvm_extra_args } + # Allow some backwards compatibility; + if $poolsize { + deprecation('jira::poolsize', 'jira::poolsize is deprecated and simply sets max-pool-size. Please use jira::pool_max_size instead and remove this configuration') + $pool_max_size_real = pick($pool_max_size, $poolsize) + } else { + $pool_max_size_real = $pool_max_size + } + if $tomcat_redirect_https_port { unless ($tomcat_native_ssl) { fail('You need to set native_ssl to true when using tomcat_redirect_https_port') diff --git a/spec/acceptance/mysql_spec.rb b/spec/acceptance/mysql_spec.rb index 1665b416..cc41751b 100644 --- a/spec/acceptance/mysql_spec.rb +++ b/spec/acceptance/mysql_spec.rb @@ -39,10 +39,10 @@ class { 'jira': homedir => '/opt/jira-home', javahome => '/usr', db => 'mysql', - dbport => '3306', + dbport => 3306, dbdriver => 'com.mysql.jdbc.Driver', dbtype => 'mysql', - tomcat_port => '8081', + tomcat_port => 8081, tomcat_native_ssl => true, tomcat_keystore_file => '/tmp/jira.ks', require => [Mysql::Db['jira'], Java_ks['jira']], diff --git a/spec/classes/jira_config_spec.rb b/spec/classes/jira_config_spec.rb index bdb4b44f..cf66ebb3 100644 --- a/spec/classes/jira_config_spec.rb +++ b/spec/classes/jira_config_spec.rb @@ -91,7 +91,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_port: '9229' + tomcat_port: 9229 } end @@ -152,7 +152,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_port: '9229', + tomcat_port: 9229, tomcat_address: '127.0.0.1' } end @@ -183,7 +183,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_port: '8888' + tomcat_port: 8888 } end @@ -198,7 +198,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_accept_count: '200' + tomcat_accept_count: 200 } end @@ -213,7 +213,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_max_http_header_size: '4096' + tomcat_max_http_header_size: 4096 } end @@ -228,7 +228,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_min_spare_threads: '50' + tomcat_min_spare_threads: 50 } end @@ -243,7 +243,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_connection_timeout: '25000' + tomcat_connection_timeout: 25000 } end @@ -258,7 +258,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_enable_lookups: 'true' + tomcat_enable_lookups: true } end @@ -288,7 +288,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_use_body_encoding_for_uri: 'false' + tomcat_use_body_encoding_for_uri: false } end @@ -303,7 +303,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_disable_upload_timeout: 'false' + tomcat_disable_upload_timeout: false } end @@ -318,7 +318,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_enable_lookups: 'true' + tomcat_enable_lookups: true } end @@ -333,7 +333,7 @@ { version: '6.3.4a', javahome: '/opt/java', - tomcat_max_threads: '300' + tomcat_max_threads: 300 } end @@ -552,10 +552,10 @@ version: '6.3.4a', javahome: '/opt/java', tomcat_native_ssl: true, - tomcat_https_port: '9443', + tomcat_https_port: 9443, tomcat_address: '127.0.0.1', - tomcat_max_threads: '600', - tomcat_accept_count: '600', + tomcat_max_threads: 600, + tomcat_accept_count: 600, tomcat_key_alias: 'keystorealias', tomcat_keystore_file: '/tmp/keyfile.ks', tomcat_keystore_pass: 'keystorepass', diff --git a/templates/dbconfig.h2.xml.erb b/templates/dbconfig.h2.xml.erb deleted file mode 100644 index 5f68d2bb..00000000 --- a/templates/dbconfig.h2.xml.erb +++ /dev/null @@ -1,23 +0,0 @@ - - - - defaultDS - default - <%= scope.lookupvar('jira::dbtype_real') %> - <%= scope.lookupvar('jira::dbschema') %> - - <%= scope.lookupvar('jira::dburl_real') %> - <%= scope.lookupvar('jira::dbdriver_real') %> - <%= scope.lookupvar('jira::dbuser') %> - <%= scope.lookupvar('jira::dbpassword') %> - <%= scope.lookupvar('jira::poolsize') %> - <%= scope.lookupvar('jira::pool_min_size') %> - <%= scope.lookupvar('jira::pool_max_size') %> - <%= scope.lookupvar('jira::pool_max_wait') %> - <%= scope.lookupvar('jira::min_evictable_idle_time') %> - <% if @time_between_eviction_runs %><%= @time_between_eviction_runs %><% else %><%= scope.lookupvar('jira::time_between_eviction_runs') %><% end %> - <%= scope.lookupvar('jira::pool_max_idle') %> - <%= scope.lookupvar('jira::pool_remove_abandoned') %> - <%= scope.lookupvar('jira::pool_remove_abandoned_timeout') %> - - diff --git a/templates/dbconfig.mysql.xml.erb b/templates/dbconfig.mysql.xml.erb deleted file mode 100644 index 1e239a64..00000000 --- a/templates/dbconfig.mysql.xml.erb +++ /dev/null @@ -1,26 +0,0 @@ - - - - defaultDS - default - <%= scope.lookupvar('jira::dbtype_real') %> - - <%= scope.lookupvar('jira::dburl_real') %> - <%= scope.lookupvar('jira::dbdriver_real') %> - <%= scope.lookupvar('jira::dbuser') %> - <%= scope.lookupvar('jira::dbpassword') %> - <%= scope.lookupvar('jira::poolsize') %> - <%= scope.lookupvar('jira::pool_min_size') %> - <%= scope.lookupvar('jira::pool_max_size') %> - <%= scope.lookupvar('jira::pool_max_wait') %> - <% if @validation_query %><%= @validation_query %><% else %>scope.lookupvar('jira::validation_query')<% end %> - <%= scope.lookupvar('jira::min_evictable_idle_time') %> - <% if @time_between_eviction_runs %><%= @time_between_eviction_runs %><% else %><%= scope.lookupvar('jira::time_between_eviction_runs') %><% end %> - <%= scope.lookupvar('jira::pool_max_idle') %> - <%= scope.lookupvar('jira::pool_remove_abandoned') %> - <%= scope.lookupvar('jira::pool_remove_abandoned_timeout') %> - <%= scope.lookupvar('jira::pool_test_while_idle') %> - <%= scope.lookupvar('jira::pool_test_on_borrow') %> - 3 - - diff --git a/templates/dbconfig.oracle.xml.erb b/templates/dbconfig.oracle.xml.erb deleted file mode 100644 index bb1b5784..00000000 --- a/templates/dbconfig.oracle.xml.erb +++ /dev/null @@ -1,24 +0,0 @@ - - - - defaultDS - default - <%= scope.lookupvar('jira::dbtype_real') %> - - <%= scope.lookupvar('jira::dburl_real') %> - <%= scope.lookupvar('jira::dbdriver_real') %> - <%= scope.lookupvar('jira::dbuser') %> - <%= scope.lookupvar('jira::dbpassword') %> - <%= scope.lookupvar('jira::pool_min_size') %> - <%= scope.lookupvar('jira::pool_max_size') %> - <%= scope.lookupvar('jira::pool_max_wait') %> - <%= scope.lookupvar('jira::pool_max_idle') %> - <%= scope.lookupvar('jira::pool_remove_abandoned') %> - <%= scope.lookupvar('jira::pool_remove_abandoned_timeout') %> - <% if @validation_query %><%= @validation_query %><% else %>scope.lookupvar('jira::validation_query')<% end %> - <%= scope.lookupvar('jira::min_evictable_idle_time') %> - <% if @time_between_eviction_runs %><%= @time_between_eviction_runs %><% else %><%= scope.lookupvar('jira::time_between_eviction_runs') %><% end %> - <%= scope.lookupvar('jira::pool_test_while_idle') %> - <%= scope.lookupvar('jira::pool_test_on_borrow') %> - - diff --git a/templates/dbconfig.postgresql.xml.erb b/templates/dbconfig.postgresql.xml.erb deleted file mode 100644 index e7cba3f9..00000000 --- a/templates/dbconfig.postgresql.xml.erb +++ /dev/null @@ -1,28 +0,0 @@ - - - - defaultDS - default - <%= scope.lookupvar('jira::dbtype_real') %> - <%= scope.lookupvar('jira::dbschema') %> - - <%= scope.lookupvar('jira::dburl_real') %> - <%= scope.lookupvar('jira::dbdriver_real') %> - <%= scope.lookupvar('jira::dbuser') %> - <%= scope.lookupvar('jira::dbpassword') %> - <%= scope.lookupvar('jira::poolsize') %> -<% if @enable_connection_pooling -%> - <%= scope.lookupvar('jira::pool_min_size') %> - <%= scope.lookupvar('jira::pool_max_size') %> - <%= scope.lookupvar('jira::pool_max_wait') %> - <% if @validation_query %><%= @validation_query %><% else %>scope.lookupvar('jira::validation_query')<% end %> - <%= scope.lookupvar('jira::min_evictable_idle_time') %> - <% if @time_between_eviction_runs %><%= @time_between_eviction_runs %><% else %><%= scope.lookupvar('jira::time_between_eviction_runs') %><% end %> - <%= scope.lookupvar('jira::pool_max_idle') %> - <%= scope.lookupvar('jira::pool_remove_abandoned') %> - <%= scope.lookupvar('jira::pool_remove_abandoned_timeout') %> - <%= scope.lookupvar('jira::pool_test_while_idle') %> - <%= scope.lookupvar('jira::pool_test_on_borrow') %> -<% end -%> - - diff --git a/templates/dbconfig.sqlserver.xml.erb b/templates/dbconfig.sqlserver.xml.erb deleted file mode 100644 index c098b1d2..00000000 --- a/templates/dbconfig.sqlserver.xml.erb +++ /dev/null @@ -1,25 +0,0 @@ - - - - defaultDS - default - <%= scope.lookupvar('jira::dbtype_real') %> - <%= scope.lookupvar('jira::dbschema') %> - - <%= scope.lookupvar('jira::dburl_real') %> - <%= scope.lookupvar('jira::dbdriver_real') %> - <%= scope.lookupvar('jira::dbuser') %> - <%= scope.lookupvar('jira::dbpassword') %> - <%= scope.lookupvar('jira::pool_min_size') %> - <%= scope.lookupvar('jira::pool_max_size') %> - <%= scope.lookupvar('jira::pool_max_wait') %> - <% if @validation_query %><%= @validation_query %><% else %>scope.lookupvar('jira::validation_query')<% end %> - <%= scope.lookupvar('jira::min_evictable_idle_time') %> - <% if @time_between_eviction_runs %><%= @time_between_eviction_runs %><% else %><%= scope.lookupvar('jira::time_between_eviction_runs') %><% end %> - <%= scope.lookupvar('jira::pool_max_idle') %> - <%= scope.lookupvar('jira::pool_remove_abandoned') %> - <%= scope.lookupvar('jira::pool_remove_abandoned_timeout') %> - <%= scope.lookupvar('jira::pool_test_while_idle') %> - <%= scope.lookupvar('jira::pool_test_on_borrow') %> - - diff --git a/templates/dbconfig.xml.epp b/templates/dbconfig.xml.epp new file mode 100644 index 00000000..1ba57d4c --- /dev/null +++ b/templates/dbconfig.xml.epp @@ -0,0 +1,54 @@ + + +<%# Some default are set in jira::config based on DB -%> + + defaultDS + default + <%= $jira::dbtype_real %> +<% if $jira::config::dbschema != undef { -%> + <%= $jira::config::dbschema %> +<% } -%> + + <%= $jira::dburl_real %> + <%= $jira::dbdriver_real %> + <%= $jira::dbuser %> + <%= $jira::dbpassword %> +<%# For most of these, Jira defaults are better... -%> +<% if $jira::pool_min_size != undef { -%> + <%= $jira::pool_min_size %> +<% } -%> +<% if $jira::pool_max_size_real != undef { -%> + <%= $jira::pool_max_size_real %> +<% } -%> +<% if $jira::pool_max_idle != undef { -%> + <%= $jira::pool_max_idle %> +<% } -%> +<% if $jira::pool_max_wait != undef { -%> + <%= $jira::pool_max_wait %> +<% } -%> +<% if $jira::min_evictable_idle_time != undef { -%> + <%= $jira::min_evictable_idle_time %> +<% } -%> +<% if $jira::pool_remove_abandoned != undef { -%> + <%= $jira::pool_remove_abandoned %> +<% } -%> +<% if $jira::pool_remove_abandoned_timeout != undef { -%> + <%= $jira::pool_remove_abandoned_timeout %> +<% } -%> +<% if $jira::pool_test_while_idle != undef { -%> + <%= $jira::pool_test_while_idle %> +<% } -%> +<% if $jira::pool_test_on_borrow != undef { -%> + <%= $jira::pool_test_on_borrow %> +<% } -%> +<% if $jira::validation_query != undef { -%> + <%= $jira::validation_query %> +<% } -%> +<% if $jira::validation_query_timeout != undef { -%> + <%= $jira::validation_query_timeout %> +<% } -%> +<% if $jira::time_between_eviction_runs != undef { -%> + <%= $jira::time_between_eviction_runs %> +<% } -%> + +