Skip to content

Commit 3393b6b

Browse files
Michael Klugekenyon
authored andcommitted
Add change password parameter
1 parent 5ed711e commit 3393b6b

4 files changed

Lines changed: 29 additions & 11 deletions

File tree

REFERENCE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ The following parameters are available in the `jira` class:
8080
* [`jndi_ds_name`](#-jira--jndi_ds_name)
8181
* [`db`](#-jira--db)
8282
* [`dbname`](#-jira--dbname)
83+
* [`change_dbpassword`](#-jira--change_dbpassword)
8384
* [`dbuser`](#-jira--dbuser)
8485
* [`dbpassword`](#-jira--dbpassword)
8586
* [`dbserver`](#-jira--dbserver)
@@ -383,6 +384,14 @@ The database name to connect to
383384

384385
Default value: `'jira'`
385386

387+
##### <a name="-jira--change_dbpassword"></a>`change_dbpassword`
388+
389+
Data type: `Boolean`
390+
391+
Set to true to actually generate a dbconfig.xml with the password - otherwise write "{ATL_SECURED}"
392+
393+
Default value: `false`
394+
386395
##### <a name="-jira--dbuser"></a>`dbuser`
387396

388397
Data type: `String`

manifests/config.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
}
4949
}
5050

51+
$change_dbpassword = $jira::change_dbpassword
52+
5153
if $jira::dbport {
5254
$dbport = $jira::dbport
5355
} else {

manifests/init.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868
# The kind of database to use.
6969
# @param dbname
7070
# The database name to connect to
71+
# @param change_dbpassword
72+
# Set to true to actually generate a dbconfig.xml with the password - otherwise write "{ATL_SECURED}"
7173
# @param dbuser
7274
# Database username
7375
# @param dbpassword
@@ -313,6 +315,7 @@
313315
Boolean $use_jndi_ds = false,
314316
String[1] $jndi_ds_name = 'JiraDS',
315317
Enum['postgresql','mysql','sqlserver','oracle','h2'] $db = 'postgresql',
318+
Boolean $change_dbpassword = false,
316319
String $dbuser = 'jiraadm',
317320
String $dbpassword = 'mypassword',
318321
String $dbserver = 'localhost',

templates/dbconfig.xml.epp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,44 +12,48 @@
1212
<url><%= $jira::config::dburl %></url>
1313
<driver-class><%= $jira::config::dbdriver %></driver-class>
1414
<username><%= $jira::dbuser %></username>
15+
<%- if $jira::config::change_dbpassword { -%>
1516
<password><%= $jira::dbpassword %></password>
17+
<%- } else { -%>
18+
<password>{ATL_SECURED}</password>
19+
<%- } -%>
1620
<%# For most of these, Jira defaults are better... -%>
1721
<% if $jira::config::pool_min_size != undef { -%>
1822
<pool-min-size><%= $jira::config::pool_min_size %></pool-min-size>
1923
<% } -%>
2024
<% if $jira::config::pool_max_size != undef { -%>
2125
<pool-max-size><%= $jira::config::pool_max_size %></pool-max-size>
2226
<% } -%>
23-
<% if $jira::config::pool_max_idle != undef { -%>
24-
<pool-max-idle><%= $jira::config::pool_max_idle %></pool-max-idle>
25-
<% } -%>
2627
<% if $jira::config::pool_max_wait != undef { -%>
2728
<pool-max-wait><%= $jira::config::pool_max_wait %></pool-max-wait>
2829
<% } -%>
30+
<% if $jira::config::validation_query != undef { -%>
31+
<validation-query><%= $jira::config::validation_query %></validation-query>
32+
<% } -%>
2933
<% if $jira::config::min_evictable_idle_time != undef { -%>
3034
<min-evictable-idle-time-millis><%= $jira::config::min_evictable_idle_time %></min-evictable-idle-time-millis>
3135
<% } -%>
36+
<% if $jira::config::time_between_eviction_runs != undef { -%>
37+
<time-between-eviction-runs-millis><%= $jira::config::time_between_eviction_runs %></time-between-eviction-runs-millis>
38+
<% } -%>
39+
<% if $jira::config::pool_max_idle != undef { -%>
40+
<pool-max-idle><%= $jira::config::pool_max_idle %></pool-max-idle>
41+
<% } -%>
3242
<% if $jira::config::pool_remove_abandoned != undef { -%>
3343
<pool-remove-abandoned><%= $jira::config::pool_remove_abandoned %></pool-remove-abandoned>
3444
<% } -%>
3545
<% if $jira::config::pool_remove_abandoned_timeout != undef { -%>
3646
<pool-remove-abandoned-timeout><%= $jira::config::pool_remove_abandoned_timeout %></pool-remove-abandoned-timeout>
3747
<% } -%>
38-
<% if $jira::config::pool_test_while_idle != undef { -%>
39-
<pool-test-while-idle><%= $jira::config::pool_test_while_idle %></pool-test-while-idle>
40-
<% } -%>
4148
<% if $jira::config::pool_test_on_borrow != undef { -%>
4249
<pool-test-on-borrow><%= $jira::config::pool_test_on_borrow %></pool-test-on-borrow>
4350
<% } -%>
44-
<% if $jira::config::validation_query != undef { -%>
45-
<validation-query><%= $jira::config::validation_query %></validation-query>
51+
<% if $jira::config::pool_test_while_idle != undef { -%>
52+
<pool-test-while-idle><%= $jira::config::pool_test_while_idle %></pool-test-while-idle>
4653
<% } -%>
4754
<% if $jira::config::validation_query_timeout != undef { -%>
4855
<validation-query-timeout><%= $jira::config::validation_query_timeout %></validation-query-timeout>
4956
<% } -%>
50-
<% if $jira::config::time_between_eviction_runs != undef { -%>
51-
<time-between-eviction-runs-millis><%= $jira::config::time_between_eviction_runs %></time-between-eviction-runs-millis>
52-
<% } -%>
5357
<% if $jira::config::connection_settings { -%>
5458
<connection-properties><%= $jira::config::connection_settings %></connection-properties>
5559
<% } -%>

0 commit comments

Comments
 (0)