Skip to content

Commit

Permalink
Add change password parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kluge committed Jan 27, 2025
1 parent 5ed711e commit 1486645
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ The following parameters are available in the `jira` class:
* [`db`](#-jira--db)
* [`dbname`](#-jira--dbname)
* [`dbuser`](#-jira--dbuser)
* [`change_dbpassword`](#-jira--change_dbpassword)
* [`dbpassword`](#-jira--dbpassword)
* [`dbserver`](#-jira--dbserver)
* [`dbport`](#-jira--dbport)
Expand Down Expand Up @@ -391,6 +392,14 @@ Database username

Default value: `'jiraadm'`

##### <a name="-jira--change_dbpassword"></a>`change_dbpassword`

Data type: `Boolean`

Set to true to actually generate a dbconfig.xml with the password - otherwise write "{ATL_SECURED}"

Default value: `false`

##### <a name="-jira--dbpassword"></a>`dbpassword`

Data type: `String`
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
# The kind of database to use.
# @param dbname
# The database name to connect to
# @param change_dbpassword
# Set to true to actually generate a dbconfig.xml with the password - otherwise write "{ATL_SECURED}"
# @param dbuser
# Database username
# @param dbpassword
Expand Down Expand Up @@ -313,6 +315,7 @@
Boolean $use_jndi_ds = false,
String[1] $jndi_ds_name = 'JiraDS',
Enum['postgresql','mysql','sqlserver','oracle','h2'] $db = 'postgresql',
Boolean $change_dbpassword = false,
String $dbuser = 'jiraadm',
String $dbpassword = 'mypassword',
String $dbserver = 'localhost',
Expand Down
26 changes: 15 additions & 11 deletions templates/dbconfig.xml.epp
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,48 @@
<url><%= $jira::config::dburl %></url>
<driver-class><%= $jira::config::dbdriver %></driver-class>
<username><%= $jira::dbuser %></username>
<%- if $jira::config::change_dbpassword { -%>
<password><%= $jira::dbpassword %></password>
<%- } else { -%>
<password>{ATL_SECURED}</password>
<%- } -%>
<%# For most of these, Jira defaults are better... -%>
<% if $jira::config::pool_min_size != undef { -%>
<pool-min-size><%= $jira::config::pool_min_size %></pool-min-size>
<% } -%>
<% if $jira::config::pool_max_size != undef { -%>
<pool-max-size><%= $jira::config::pool_max_size %></pool-max-size>
<% } -%>
<% if $jira::config::pool_max_idle != undef { -%>
<pool-max-idle><%= $jira::config::pool_max_idle %></pool-max-idle>
<% } -%>
<% if $jira::config::pool_max_wait != undef { -%>
<pool-max-wait><%= $jira::config::pool_max_wait %></pool-max-wait>
<% } -%>
<% if $jira::config::validation_query != undef { -%>
<validation-query><%= $jira::config::validation_query %></validation-query>
<% } -%>
<% if $jira::config::min_evictable_idle_time != undef { -%>
<min-evictable-idle-time-millis><%= $jira::config::min_evictable_idle_time %></min-evictable-idle-time-millis>
<% } -%>
<% if $jira::config::time_between_eviction_runs != undef { -%>
<time-between-eviction-runs-millis><%= $jira::config::time_between_eviction_runs %></time-between-eviction-runs-millis>
<% } -%>
<% if $jira::config::pool_max_idle != undef { -%>
<pool-max-idle><%= $jira::config::pool_max_idle %></pool-max-idle>
<% } -%>
<% if $jira::config::pool_remove_abandoned != undef { -%>
<pool-remove-abandoned><%= $jira::config::pool_remove_abandoned %></pool-remove-abandoned>
<% } -%>
<% if $jira::config::pool_remove_abandoned_timeout != undef { -%>
<pool-remove-abandoned-timeout><%= $jira::config::pool_remove_abandoned_timeout %></pool-remove-abandoned-timeout>
<% } -%>
<% if $jira::config::pool_test_while_idle != undef { -%>
<pool-test-while-idle><%= $jira::config::pool_test_while_idle %></pool-test-while-idle>
<% } -%>
<% if $jira::config::pool_test_on_borrow != undef { -%>
<pool-test-on-borrow><%= $jira::config::pool_test_on_borrow %></pool-test-on-borrow>
<% } -%>
<% if $jira::config::validation_query != undef { -%>
<validation-query><%= $jira::config::validation_query %></validation-query>
<% if $jira::config::pool_test_while_idle != undef { -%>
<pool-test-while-idle><%= $jira::config::pool_test_while_idle %></pool-test-while-idle>
<% } -%>
<% if $jira::config::validation_query_timeout != undef { -%>
<validation-query-timeout><%= $jira::config::validation_query_timeout %></validation-query-timeout>
<% } -%>
<% if $jira::config::time_between_eviction_runs != undef { -%>
<time-between-eviction-runs-millis><%= $jira::config::time_between_eviction_runs %></time-between-eviction-runs-millis>
<% } -%>
<% if $jira::config::connection_settings { -%>
<connection-properties><%= $jira::config::connection_settings %></connection-properties>
<% } -%>
Expand Down

0 comments on commit 1486645

Please sign in to comment.