|
42 | 42 | # can't use pick_default: https://tickets.puppetlabs.com/browse/MODULES-11018 |
43 | 43 | $dbschema = if $jira::dbschema { $jira::dbschema } else { $dbschema_default } |
44 | 44 |
|
45 | | - # Allow some backwards compatibility; |
46 | | - if $jira::poolsize { |
47 | | - deprecation('jira::poolsize', 'jira::poolsize is deprecated and simply sets max-pool-size. Please use jira::pool_max_size instead and remove this configuration') |
48 | | - $pool_max_size_real = pick($jira::pool_max_size, $jira::poolsize) |
49 | | - } else { |
50 | | - $pool_max_size_real = $jira::pool_max_size |
51 | | - } |
52 | | - |
53 | 45 | if $jira::tomcat_redirect_https_port { |
54 | 46 | unless $jira::tomcat_native_ssl { |
55 | 47 | fail('You need to set jira::tomcat_native_ssl to true when using jira::tomcat_redirect_https_port') |
56 | 48 | } |
57 | 49 | } |
58 | 50 |
|
59 | 51 | if $jira::dbport { |
60 | | - $dbport_real = $jira::dbport |
| 52 | + $dbport = $jira::dbport |
61 | 53 | } else { |
62 | | - $dbport_real = $jira::db ? { |
| 54 | + $dbport = $jira::db ? { |
63 | 55 | 'postgresql' => '5432', |
64 | 56 | 'mysql' => '3306', |
65 | 57 | 'oracle' => '1521', |
|
69 | 61 | } |
70 | 62 |
|
71 | 63 | if $jira::dbdriver { |
72 | | - $dbdriver_real = $jira::dbdriver |
| 64 | + $dbdriver = $jira::dbdriver |
73 | 65 | } else { |
74 | | - $dbdriver_real = $jira::db ? { |
| 66 | + $dbdriver = $jira::db ? { |
75 | 67 | 'postgresql' => 'org.postgresql.Driver', |
76 | 68 | 'mysql' => 'com.mysql.jdbc.Driver', |
77 | 69 | 'oracle' => 'oracle.jdbc.OracleDriver', |
|
81 | 73 | } |
82 | 74 |
|
83 | 75 | if $jira::dbtype { |
84 | | - $dbtype_real = $jira::dbtype |
| 76 | + $dbtype = $jira::dbtype |
85 | 77 | } else { |
86 | | - $dbtype_real = $jira::db ? { |
| 78 | + $dbtype = $jira::db ? { |
87 | 79 | 'postgresql' => 'postgres72', |
88 | 80 | 'mysql' => 'mysql', |
89 | 81 | 'oracle' => 'oracle10g', |
|
93 | 85 | } |
94 | 86 |
|
95 | 87 | if $jira::dburl { |
96 | | - $dburl_real = $jira::dburl |
| 88 | + $dburl = $jira::dburl |
97 | 89 | } |
98 | 90 | else { |
99 | 91 | # SIDs use :, service names use / |
100 | 92 | $oracle_separator = bool2str($jira::oracle_use_sid, ':', '/') |
101 | | - $dburl_real = $jira::db ? { |
102 | | - 'postgresql' => "jdbc:${jira::db}://${jira::dbserver}:${dbport_real}/${jira::dbname}", |
103 | | - 'mysql' => "jdbc:${jira::db}://${jira::dbserver}:${dbport_real}/${jira::dbname}?useUnicode=true&characterEncoding=UTF8&sessionVariables=default_storage_engine=InnoDB", |
104 | | - 'oracle' => "jdbc:${jira::db}:thin:@${jira::dbserver}:${dbport_real}${oracle_separator}${jira::dbname}", |
105 | | - 'sqlserver' => "jdbc:jtds:${jira::db}://${jira::dbserver}:${dbport_real}/${jira::dbname}", |
| 93 | + $dburl = $jira::db ? { |
| 94 | + 'postgresql' => "jdbc:${jira::db}://${jira::dbserver}:${dbport}/${jira::dbname}", |
| 95 | + 'mysql' => "jdbc:${jira::db}://${jira::dbserver}:${dbport}/${jira::dbname}?useUnicode=true&characterEncoding=UTF8&sessionVariables=default_storage_engine=InnoDB", |
| 96 | + 'oracle' => "jdbc:${jira::db}:thin:@${jira::dbserver}:${dbport}${oracle_separator}${jira::dbname}", |
| 97 | + 'sqlserver' => "jdbc:jtds:${jira::db}://${jira::dbserver}:${dbport}/${jira::dbname}", |
106 | 98 | 'h2' => "jdbc:h2:file:/${jira::homedir}/database/${jira::dbname}", |
107 | 99 | } |
108 | 100 | } |
109 | 101 |
|
| 102 | + # Allow some backwards compatibility; |
| 103 | + if $jira::poolsize { |
| 104 | + deprecation('jira::poolsize', 'jira::poolsize is deprecated and simply sets max-pool-size. Please use jira::pool_max_size instead and remove this configuration') |
| 105 | + } |
| 106 | + |
| 107 | + $pool_min_size = pick($jira::pool_min_size, 20) |
| 108 | + $pool_max_size = pick($jira::pool_max_size, $jira::poolsize, 20) |
| 109 | + $pool_max_wait = pick($jira::pool_max_wait, 30000) |
| 110 | + $pool_max_idle = pick($jira::pool_max_idle, 20) |
| 111 | + $pool_remove_abandoned = pick($jira::pool_remove_abandoned, true) |
| 112 | + $pool_remove_abandoned_timeout = pick($jira::pool_remove_abandoned_timeout, 300) |
| 113 | + $min_evictable_idle_time = pick($jira::min_evictable_idle_time, 60000) |
| 114 | + $time_between_eviction_runs = pick($jira::time_between_eviction_runs, 300000) |
| 115 | + $pool_test_while_idle = pick($jira::pool_test_while_idle, true) |
| 116 | + $pool_test_on_borrow = pick($jira::pool_test_on_borrow, false) |
| 117 | + |
| 118 | + # This is just for consistency |
| 119 | + $connection_settings = $jira::connection_settings |
| 120 | + |
| 121 | + if $jira::db == 'mysql' { |
| 122 | + $validation_query_timeout = pick($jira::validation_query_timeout, 3) |
| 123 | + } else { |
| 124 | + $validation_query_timeout = $jira::validation_query_timeout |
| 125 | + } |
| 126 | + |
| 127 | + if $jira::validation_query { |
| 128 | + $validation_query = $jira::validation_query |
| 129 | + } else { |
| 130 | + $validation_query = $jira::db ? { |
| 131 | + 'mysql' => 'select 1', |
| 132 | + 'sqlserver' => 'select 1', |
| 133 | + 'oracle' => 'select 1 from dual', |
| 134 | + 'postgresql' => 'select version();', |
| 135 | + 'h2' => undef, |
| 136 | + } |
| 137 | + } |
| 138 | + |
110 | 139 | $tomcat_protocol_ssl_real = pick($jira::tomcat_protocol_ssl, 'org.apache.coyote.http11.Http11NioProtocol') |
111 | 140 |
|
112 | 141 | $jira_properties = { |
|
0 commit comments