jboss
Version information
This version is compatible with:
- Puppet >=2.7.0 <4.0.0
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'coi-jboss', '1.2.1'
Learn more about managing modules with a PuppetfileDocumentation
Puppet Module for JBoss EAP and Wildfly application servers
...with configuration management of resources and deployment in domain and stand-alone modes
Table of Contents
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with JBoss
- What JBoss module affects
- Beginning with JBoss module
- Install classes reference
- Configuration classes reference
- Application defined types reference
- Technical defined types reference
- Logging configuration defined types
- JBoss module standard metaparameters
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Overview
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.
Module Description
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:
- Installation and upgrading of application servers in domain and standalone modes,
- support for JBoss AS, EAP, and WildFly,
- support for the Red Hat and Debian operating systems families,
- installation of internal JBoss modules and their generation from a set of libraries,
- configuration in a domain configuration mode (including the creation of virtual servers and groups of servers) and also standalone mode,
- JBoss user management,
- management of JBoss network interfaces,
- JPA datasource management, security domains, JMS queues, resource adapters and system logging
- deployment and removing of artifacts
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.
Got questions?
We will be happy to receive your feedback. Ask as about everything releated to this module on Gitter.im chat!
Setup
What JBoss module affects
- This module installs JBoss Application Servers from zip files distributed by Red Hat. Those files are being extracted to target directory, by default:
/usr/lib/<product>-<version>/
for ex.:/usr/lib/wildfly-8.2.0.Final
. - Module will also add service with name of
$jboss::product
for ex.:/etc/init.d/wildfly
- By default module will install default Java JDK using
puppetlabs/java
module. This can be turned off by using$jboss::java_autoinstall
variable or hiera key:jboss::params::java_autoinstall
- By default module will install and use
wget
package to download zip files
Beginning with JBoss module
To 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: 'jboss-as'
jboss::params::version: '7.1.1.Final'
Install classes reference
Those classes are main module classes, that handles most of the typical workflow. Use them to install the main porduct - JBoss or Wildfly.
The jboss
install class
The 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,
}
More about jboss
class on Wiki.
Configure classes reference
Those classes are here to configure your JBoss/Wildfly instance.
The jboss::domain::controller
configure class
This 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,
}
The jboss::domain::node
configure class
This 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 reference
Application defined types are here to be directly expected by applications running on your application server. Most likely to written by application developers.
The jboss::datasource
defined type
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'
}
}
More on parameters for jboss::datasource
defined type on Wiki.
The jboss::jmsqueue
defined type
Use 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.
The jboss::resourceadapter
defined type
This 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.
The jboss::securitydomain
defined type
This 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.
The jboss::module
defined type
This 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.
The jboss::clientry
defined type
This 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 reference
Technical defined types will be most likely used by system administrators to configure JBoss application servers to theirs needs.
The jboss::deploy
defined type
This 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.
The jboss::user
defined type
Use 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.
The jboss::interface
defined type
This 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.
The jboss::domain::server
defined type
This 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.
The jboss::domain::servergroup
defined type
This 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
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.
JBoss module standard metaparameters
Most of the defined types uses JBoss Puppet module standard metaparameters. Their description can be found on Wiki page.
Limitations
This module is explicitly tested on:
- Oracle Linux 6.x, CentOS 6.x
- Ubuntu Server LTS 14.04
With servers:
- JBoss AS 7.1
- JBoss EAP 6.1 - 6.4, 7.0
- WildFly 8.x, 9.x
Should be fully compatible with those operating systems:
- Red Hat Enterprise Linux: 5.x, 6.x
- CentOS: 5.x, 6.x
- Scientific: 5.x, 6.x
- Oracle Linux: 5.x
- Debian: 6.x, 7.x
- Ubuntu Server LTS 12.04, 10.04
Supported Puppet versions:
- Puppet OSS: 2.7.x, 3.x
- Puppet Enterprise: 2.8.x, 3.x
Development
To contribute to this module please read carefully the CONTRIBUTING.md
Release Notes
1.0.3
- RubyCake- Bug: #9 Correct a way that options are validated and displyed for datasource type
- Bug: #8 Correct a way that port and host are validated for datasource type
- Bug: #21 Fix hiera key in params.pp for java_autoinstall parameter
- Bug: #17 Fix to be able to supply install zip as off-line file
- Quality: #22 Fix Puppet Forge warning: "Dependencies contain unbounded ranges."
- Quality: #41 Adding code of conduct file
- Tests: #10 Write spec test to cover not covered Ruby files (up 80%)
- CI: #34 Running acceptance tests on rvm 2.1 instead of default
- CI: #4 Try to execute standard Ruby builds on Travis CI on container infrastructure
1.0.2
- MintyFrost- Enhancement: move documentation to the Wiki and document all public manifests
- Bug: make acceptance tests work on Travis
1.0.0
- First public release- First publicly available version
- Support for JBoss EAP, JBoss AS and Wildfly
- Support for JPA datasource management, Security Domain JBoss, JMS queues, resource adapters and messages logging
- Support for deploying artifacts
Types in this module release
Dependencies
- puppetlabs/java (>= 1.0.1 <2.0.0)
- puppetlabs/stdlib (>= 3.2.0 <5.0.0)
- puppetlabs/concat (>= 1.0.0 <2.0.0)
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2015-2018 Centralny Ośrodek Informatyki Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.