Skip to content

Commit

Permalink
Added schema parameter for dbconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
AZaugg committed Nov 24, 2015
1 parent 5a0be9b commit fd1d236
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 4 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ The database driver to use, defaults to 'org.postgresql.Driver'. Can be 'org.pos

Database type, defaults to 'postgres72'. Can be 'postgres72', 'mysql', 'oracle10g', or 'mssql'. Atlassian only supports Oracle 11g, even so this value should be as documented here.

#####`$dbschema`

Set the schema

The Default value is 'public'

#####`$poolsize`

The connection pool size to the database, defaults to 20
Expand Down
6 changes: 6 additions & 0 deletions jira.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ jira::dbport: 5432
#jira::dbport: 1521
#jira::dbport: 1433

# Schema
# Defauult for postgres
jira::dbschema: 'public'
# Default for mssql
#jira::dbschema: 'dbo'

# The connection pool size
jira::poolsize: 20
jira::enable_connection_pooling: false
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
$dbtype = 'postgres72',
$dburl = undef,
$poolsize = '20',
$dbschema = 'public',

# MySQL Connector Settings
$mysql_connector_manage = true,
Expand Down
6 changes: 4 additions & 2 deletions spec/classes/jira_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/bin/user.sh')}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')}
it { should contain_file('/home/jira/dbconfig.xml')
.with_content(/<url>jdbc:postgresql:\/\/localhost:5432\/jira<\/url>/) }
.with_content(/<url>jdbc:postgresql:\/\/localhost:5432\/jira<\/url>/)
.with_content(/<schema-name>public<\/schema-name>/) }
end

context 'mysql params' do
Expand All @@ -40,12 +41,13 @@
:javahome => '/opt/java',
:db => 'sqlserver',
:dbport => '1433',
:dbschema => 'public',
}}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/bin/setenv.sh')}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/bin/user.sh')}
it { should contain_file('/opt/jira/atlassian-jira-6.3.4a-standalone/conf/server.xml')}
it { should contain_file('/home/jira/dbconfig.xml')
.with_content(/<url>jdbc:jtds:sqlserver:\/\/localhost:1433\/jira<\/url>/) }
.with_content(/<schema-name>public<\/schema-name>/) }
end

context 'custom dburl' do
Expand Down
2 changes: 1 addition & 1 deletion templates/dbconfig.postgresql.xml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type><%= scope.lookupvar('jira::dbtype') %></database-type>
<schema-name>public</schema-name>
<schema-name><%= scope.lookupvar('jira::dbschema') %></schema-name>
<jdbc-datasource>
<url><%= scope.lookupvar('jira::dburl_real') %></url>
<driver-class><%= scope.lookupvar('jira::dbdriver') %></driver-class>
Expand Down
2 changes: 1 addition & 1 deletion templates/dbconfig.sqlserver.xml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>defaultDS</name>
<delegator-name>default</delegator-name>
<database-type><%= scope.lookupvar('jira::dbtype') %></database-type>
<schema-name>dbo</schema-name>
<schema-name><%= scope.lookupvar('jira::dbschema') %></schema-name>
<jdbc-datasource>
<url><%= scope.lookupvar('jira::dburl_real') %></url>
<driver-class><%= scope.lookupvar('jira::dbdriver') %></driver-class>
Expand Down

0 comments on commit fd1d236

Please sign in to comment.