This module can install JBoss Enterprise Application Platform and WildFly application servers. It can also manage their resources and applications in either a domain or a stand-alone mode. It supports resources like datasource, security domain, JMS queues and any other custom CLI reachable attributes and path. It can also deploy your applications.
The Center for Information Technology in Poland manage the JBoss application server farm. We were looking for a simple tool to support and automate the management of these servers in the spirit of DevOps methodology. The tool should also be powerful enough to satisfy all, even future requirements. Nothing was able to meet our requirements, so we have designed and wrote the corresponding Puppet module.
The module allows user to perform all necessary operations for JBoss servers. Here are couple of features:
In addition to the above list, you can also configure any JBoss CLI reachable configuration, with the entire set of parameters. This allows you to configure any parameter supported by JBoss.
We will be happy to receive your feedback. Ask as about everything releated to this module on Gitter.im chat!
/usr/lib/<product>-<version>/
for ex.: /usr/lib/wildfly-8.2.0.Final
.$jboss::product
for ex.: /etc/init.d/wildfly
puppetlabs/java
module. This can be turned off by using $jboss::java_autoinstall
variable or hiera key: jboss::params::java_autoinstall
wget
package to download zip filesTo install JBoss Application Server you can use just, it will install Wildfly 8.2.0.Final by default:
include jboss
To install JBoss EAP or older JBoss AS use:
class { 'jboss':
product => 'jboss-eap',
version => '6.4.0.GA',
}
or use hiera:
jboss::params::product: 'wildfly'
jboss::params::version: '10.1.0.Final'
Those classes are main module classes, that handles most of the typical workflow. Use them to install the main porduct - JBoss or Wildfly.
jboss
install classThe jboss
main class is used to install the application server itself. It can install it on default parameters but you can use then to customize installation procedure.
Example:
include jboss
or with parameters:
class { 'jboss':
enableconsole => true,
environment => {
'JAVA_OPTS' => "\${JAVA_OPTS} -XX:+UseG1GC",
},
}
More about jboss
class on Wiki.
Those classes are here to configure your JBoss/Wildfly instance.
jboss::domain::controller
configure classThis class will setup parameters for JBoss server to run as controller of the domain. It has no parameters. This class must be used before main JBoss class for ex.:
# This include must be defined before JBoss main class
include jboss::domain::controller
class { 'jboss':
enableconsole => true,
}
jboss::domain::node
configure classThis class will setup JBoss server to run as node of the domain.
It takes two parameters: ctrluser
and ctrlpassword
. User name and password must be setup to JBoss controller. Easiest way to add jboss management user with jboss::user
type.
$user = 'jb-user'
$passwd = 'SeC3eT!1'
node 'controller' {
include jboss::domain::controller
include jboss
jboss::user { $user:
ensure => 'present',
password => $passwd,
}
}
node 'node' {
class { 'jboss::domain::node':
ctrluser => $user,
ctrlpassword => $passwd,
}
}
Application defined types are here to be directly expected by applications running on your application server. Most likely to written by application developers.
jboss::datasource
defined typeThis 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'
}
}
More on parameters for jboss::datasource
defined type on Wiki.
jboss::jmsqueue
defined typeUse this defined type to add and remove JBoss JMS Queues.
jboss::jmsqueue { 'app-mails':
ensure => 'present',
durable => true,
entries => [
'queue/app-mails',
'java:jboss/exported/jms/queue/app-mails',
],
}
More on parameters for jboss::jmsqueue
defined type on Wiki.
jboss::resourceadapter
defined typeThis defined type can be used to add and remove JBoss resource adapters. A resource adapter is a deployable Java EE component that provides communication between a Java EE application and an Enterprise Information System (EIS) using the Java Connector Architecture (JCA) specification
See more info here: https://docs.oracle.com/javaee/6/tutorial/doc/bncjh.html
jboss::deploy { 'jca-filestore.rar':
jndi => 'jca-filestore.rar',
}
jboss::resourceadapter { 'jca-filestore.rar':
archive => 'jca-filestore.rar',
transactionsupport => 'LocalTransaction',
classname => 'org.example.jca.FileSystemConnectionFactory',
jndiname => 'java:/jboss/jca/photos',
require => JBoss::Deploy['jca-filestore.rar'],
}
More on parameters for jboss::resourceadapter
defined type on Wiki.
jboss::securitydomain
defined typeThis defined type can be used to add and remove JBoss security domains. A security domain consists of configurations for authentication, authorization, security mapping, and auditing. It implements Java Authentication and Authorization Service (JAAS) declarative security.
jboss::securitydomain { 'db-auth-default':
ensure => 'present',
code => 'Database',
codeflag => 'required',
moduleoptions => {
'dsJndiName' => 'java:jboss/datasources/default-db',
'principalsQuery' => 'select \'password\' from users u where u.login = ?',
'hashUserPassword' => false,
'hashStorePassword' => false,
'rolesQuery' => 'select r.name, \'Roles\' from users u
join user_roles ur on ur.user_id = u.id
join roles r on r.id = ur.role_id
where u.login = ?',
},
}
More on parameters for jboss::securitydomain
defined type on Wiki.
jboss::module
defined typeThis defined type can add and remove JBoss static modules. Static modules are predefined in
the JBOSS_HOME/modules/
directory of the application server. Each sub-directory represents
one module and contains one or more JAR files and a configuration file - module.xml
.
More info on modules here: https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Development_Guide/chap-Class_Loading_and_Modules.html
jboss::module { 'postgresql-jdbc':
layer => 'jdbc',
artifacts => [
'https://jdbc.postgresql.org/download/postgresql-9.4-1204.jdbc41.jar',
],
dependencies => [
'javax.transaction.api',
'javax.api',
],
}
After processing of this module JBoss server will be automatically restarted, but only when changes occur.
More on parameters for jboss::module
defined type on Wiki.
jboss::clientry
defined typeThis define is very versatile. It can be used to add or remove any JBoss CLI entry. You can pass any number of properties for given CLI path and each one will be manage, other parameters will not be changed.
jboss::clientry { '/subsystem=messaging/hornetq-server=default':
ensure => 'present',
properties => {
'security-enabled' => false,
}
}
More on parameters for jboss::clientry
defined type on Wiki.
Technical defined types will be most likely used by system administrators to configure JBoss application servers to theirs needs.
jboss::deploy
defined typeThis defined type can be used to deploy and undeploy standard Java artifacts to JBoss server
jboss::deploy { 'foobar-app':
ensure => 'present',
servergroup => 'foobar-group',
path => '/usr/src/foobar-app-1.0.0.war',
}
More on parameters for jboss::deploy
defined type on Wiki.
jboss::user
defined typeUse this defined type to add and remove JBoss management and application users, manage their passwords and roles.
jboss::user { 'admin':
ensure => 'present',
realm => 'ManagementRealm',
password => 'seCret1!',
}
More on parameters for jboss::user
defined type on Wiki.
jboss::interface
defined typeThis defined type can be used to setup JBoss interfaces. It can add, remove or change existing interfaces.
More info about interfaces may be found here: https://docs.jboss.org/author/display/WFLY8/Interfaces+and+ports
jboss::interface { 'public':
ensure => 'present',
inet_address => '192.168.5.33',
}
More on parameters for jboss::interface
defined type on Wiki.
jboss::domain::server
defined typeThis defined type simplifies creation and removal and updating JBoss domain virtual server (server instance) running on a host server (host controller) in domain mode.
include jboss
jboss::domain::servergroup { 'appsrv-group':
ensure => 'present',
profile => 'full-ha',
heapsize => '2048m',
maxheapsize => '2048m',
jvmopts => '-XX:+UseG1GC -XX:MaxGCPauseMillis=200',
system_properties => {
'java.security.egd' => 'file:/dev/urandom',
}
}
jboss::domain::server { 'appsrv-01':
ensure => 'present',
group => 'appsrv-group',
}
More on parameters for jboss::domain::server
defined type on Wiki.
jboss::domain::servergroup
defined typeThis defined type simplifies creation and removal and updating JBoss domain server group that can enforce same configuration (profile, deployments and JVM settings) across multiple servers on multiple host controllers. This is only possible in domain mode.
include jboss
jboss::domain::servergroup { 'app-group':
ensure => 'present',
profile => 'full-ha',
heapsize => '2048m',
maxheapsize => '2048m',
jvmopts => '-XX:+UseG1GC -XX:MaxGCPauseMillis=200',
system_properties => {
'java.security.egd' => 'file:/dev/urandom',
}
}
More on parameters for jboss::domain::servergroup
defined type on Wiki.
Logging configuration defined types are wrappers for jboss::clientry
type, being written for ease of use for system administrators.
jboss::logging::root
- This defined type can be used to manage JBoss root logger easily.jboss::logging::logger
- This defined type can be used to manage named loggers.jboss::logging::console
- This defined type can be used to manage console handlers for logging.jboss::logging::file
- This defined type can be used to manage periodic rotating file handlers.jboss::logging::async
- This defined type can be used to manage asynchronous file handlers.jboss::logging::syslog
- This defined type can be used to manage syslog handlers.Most of the defined types uses JBoss Puppet module standard metaparameters. Their description can be found on Wiki page.
This module is explicitly tested on:
With servers:
Should be fully compatible with those operating systems:
Supported Puppet versions:
To contribute to this module please read carefully the CONTRIBUTING.md
1.2.1
- PeachSplash
1.2.0
- PoppySilver
1.1.0
- RiverBlue
1.0.3
- RubyCake
1.0.2
- MintyFrost
1.0.0
- First public release