-
Notifications
You must be signed in to change notification settings - Fork 8
Defined type jboss::datasource
This defined type can be used to add and remove JBoss data sources. It support both XA and Non-XA data sources. It can setup data sources and manage required drivers.
# Non-XA data source
jboss::datasource { 'test-datasource':
ensure => 'present',
username => 'test-username',
password => 'test-password',
jdbcscheme => 'h2:mem',
dbname => 'testing;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
host => '',
port => '',
driver => {
'name' => 'h2',
}
}
# XA data source
jboss::datasource { 'test-xa-datasource':
ensure => 'present',
xa => true,
username => 'test-username',
password => 'test-password',
jdbcscheme => 'h2:mem',
dbname => 'testing-xa;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
host => '',
port => '',
driver => {
'name' => 'h2',
'driver-xa-datasource-class-name' => 'org.h2.jdbcx.JdbcDataSource'
}
}
Parameters for jboss::datasource
:
This type uses JBoss module standard metaparameters
Required parameter. This is the JDBC scheme for ex.: postgresql
, oracle
, mysql
, mssql
or h2:mem
. All accepted by JBoss JDBC shemes are valid.
Required parameter. This is the name of the database host or it's IP address. Pass empty string ''
if host isn't needed.
Required parameter. This is the port of the database. Pass empty string ''
if port isn't needed.
Required parameter. This is the user name that will be used to connect to database.
Required parameter. This is the password that will be used to connect to database.
This is the namevar. Name of the database to be used.
Standard ensure parameter. Can be either present
or absent
.
Java JNDI name of the datasource. Be default it is equals to java:jboss/datasources/<name>
This parameters indicate that given data source should XA or Non-XA type. Be default this is equal to false
This parameters indicate that given data source should support Java JTA transactions. Be default this is equal to true
Minimum connections in connection pool. By default it is equal to 1
.
Maximum connections in connection pool. By default it is equal to 50
.
This parameter control whether given data source should be enabled or not. By default it is equal to true
.
This is an extra options hash. You can give any additional options that will be passed directly to JBoss data source. Any supported by JBoss values will be accepted and enforced. Values that are not mentioned are not processed.
Default options added to every data source (they can be overwritten):
-
validate-on-match
=>false
-
background-validation
=>false
-
share-prepared-statements
=>false
-
prepared-statements-cache-size
=>0
Default options added to every XA data source (they can be overwritten):
-
same-rm-override
=>true
-
wrap-xa-resource
=>true