Forge Home

jboss

Manage installation and set up of JBoss 4, 5, 7, and WildFly 8, 12 instances.

19,529 downloads

5,282 latest version

3.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 2.3.2 (latest)
  • 2.3.1
  • 2.2.3
  • 2.2.1
  • 2.2.0
  • 2.1.2
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • 1.1.1
  • 1.1.0 (deleted)
  • 1.0.8
  • 1.0.7
  • 1.0.6
  • 1.0.5
  • 1.0.4
  • 1.0.3
  • 1.0.2
  • 1.0.1
  • 1.0.0
released Dec 17th 2018
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.0.0
  • Ubuntu, Debian, RedHat, CentOS

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'dsestero-jboss', '2.3.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add dsestero-jboss
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install dsestero-jboss --version 2.3.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

dsestero/jboss — version 2.3.2 Dec 17th 2018

sudo #jboss

####Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with jboss
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

##Overview

This is the jboss module. It provides classes and defines to install, configure, and create services for jboss instances for the versions 4, 5, 7 of JBoss-GA, WildFly-8 and WildFly-12.

##Module Description

Creates, configures and sets up the service, i.e. a server profile with all the configurations needed to use it as an independent service, for JBoss instances for the community versions:

  • JBoss-4.x.y.GA
  • JBoss-5.1.0.GA
  • JBoss-7.1.1.Final
  • WildFly-8.2.0.Final
  • WildFly-12.0.0.Final

Note: at this time WildFly instances are created as standalone standard profiles.

The module takes care to set up a secondary network interface on which the instance will be listening.

The module incorporates sensible defaults so the only required parameter is the resource title that will be used as instance name.

##Setup

###What jboss affects

The module impact in various ways on the node:

  • JBoss distribution and profiles are installed in /opt folder;
  • logs go in /var/jboss/server/[instance_name] folder;
  • applications specific files go in /var/lib/jboss/apps/[appname] folder;
  • a service is created in /etc/init.d with the name jboss-[instance_name] and configured to start at boot;
  • users belonging to jboss group gain specific sudoers permissions in order to start and stop jboss services, to su to jboss user, to use basic network debug tools like netstat and nmap, and to enable/disable/launch a single run of puppet agent;
  • if an IP address is specified to make the instance listening then a secondary network interface with the specified IP is configured and activated;
  • an alias for the specified IP is created in the /etc/hosts file as [instance_name]-[environment];
  • a script to zip and delete old logs in /var/jboss/server/[instance_name] folder is installed in /home/jboss/bin and scheduled as a cron job of the jboss user;
  • a script to ease the management of JBoss services is installed in /usr/local/bin;
  • JBoss-4 and JBoss-5 instances will include the installation of Java-6 while Jboss-7 and WildFly-8 instances will include the installation of Java-7.
  • if WildFly-8 instances are installed on a node then a symbolic link /opt/jboss-8 is created to one of them in order to have the possibility to access the scripts in the WildFly bin directory on a standard path (e.g. to access jboss-cli.sh in postconfig manifests).CHECK

If PuppetDB is installed the module exports two kind of resources:

  • the paths to backup the configurations of the specific instances created on a given node in a given environment. (The node fqdn and the environment tag concat::fragment resources).

The module provides a class jboss::alias_jboss that use the first above mentioned exported resource to define a utility class to add all jboss instances hostnames in the hosts file of a node.

For JBoss instances 5, 7, 8 and 12 JBoss logs will be configured with a special category 'LoggerPrestazioni' that appends to a DailyRollingFileAppender named prestazioni.log. We use such category to log timings of the different servlets, in order to evaluate overall performances of the webapps.

In order to prevent Puppet to alter specific instance configuration files the general rule followed is to create required JBoss-instance specific configurations (like the above affecting logs) only when they are absent and leaving the files untouched if the configurations already exist.

###Setup Requirements

This modules requires the following other modules to be installed:

  • dsestero/download_uncompress

    to provide the basic capability to download and unzip the JBoss distributions

  • dsestero/java

    to install a suitable java development environment

  • puppetlabs/concat

    to create the lines needed to configure backup

  • puppetlabs/concat

    to collect informations about the instances installed on a node.

  • puppetlabs/stdlib

    to use various functions and the file_line resource.

To make use of the exported resources mentioned in reference PuppetDB has to be installed.

###Beginning with jboss

To get a jboss instance up and running one has to install a specific version of the JBoss Community distribution and then to declare the specific instance. This is done, for example, by declarations as the following:

include jboss::jboss_8
jboss::instance_8 { 'instanceName': }

In the above example a WildFly-8 standalone instance is configured to listen on localhost (127.0.0.1) as a development (dev) environment without creating management or jmx users.

##Usage

The basic usage is as in the following example:

include jboss::jboss_8
jboss::instance_8 { 'instanceName':
    environment => 'prod',
    ip          => '172.16.13.15',
    iface       => 'eth0:8',
    mgmt_user   => $mgmt_user,
    mgmt_passwd => $mgmt_passwd,
}

If ip is provided but no iface then the instance will listen on the specified ip but no specific secondary interface will be created.

It is possible to specify additional attributes like the Xms and Xmx (start and maximum heap memory used by the instance) or the smtp configurations for the JBoss mail service:

  jboss::instance_5 { 'instanceName':
    profile     => 'web',
    ws_enabled  => true,
    environment => 'prod',
    ip          => '172.16.12.165',
    iface       => 'eth0:1',
    jmxport     => '12345',
    xmx         => '1024m',
    mgmt_user   => 'admin_user',
    mgmt_passwd => 'suitable_password',
    jmx_user    => 'jmx_user_eg_zabbixmon',
    jmx_passwd  => 'suitable_jmx_password',
    smtp_ip     => '172.16.10.10',
    smtp_domain => 'regione.vda.it',
  } ->
  jboss::instance_5::lib::oracle::install { 'agri1':
  } ->
  jboss::instance_5::lib::zk::install { 'agri1':
  }

It is possible to concatenate the declarations for specific libraries as in, for example:

  jboss::instance_8 { 'transito8':
    environment => 'test',
    mgmt_user   => 'mgmt_user',
    mgmt_passwd => 'mgmt_passwd',
  } ->
  jboss::instance_8::lib::oracle::install { 'transito8':
    environment => 'test',
  } ->
  jboss::instance_8::lib::postgresql::install { 'transito8':
    environment => 'test',
  } ->
  jboss::instance_8::lib::springframework::install { 'transito8':
    environment => 'test',
  }

For WildFly-8 instances it is possible to configure the JVM so that in case of an OutOfMemory Error a heap dump be generated in a specified location. We suggest to use a dedicated partition with enough memory to hold the dump.

###Exported resources

The exported paths to backup for a given node can be collected, for instance to configure a backup, script with a declaration like the following:

  Concat::Fragment <<| target == '/usr/local/bin/backupall.sh.conf' and tag == $facts['networking']['fqdn'] |>> {
  }

  concat { '/usr/local/bin/backupall.sh.conf':
    ensure => present,
  }

The names of all instances defined on a node, one per line, are exported and the following code, that is actually part of class jboss::install can be used in case one needs such a file:

  Concat::Fragment <<| target == '/usr/local/bin/jboss-instance-list.conf' and tag == $facts['networking']['fqdn'] |>> {
  }

  concat { '/usr/local/bin/jboss-instance-list.conf':
    ensure => present,
  }

Furthermore, the module provides a class jboss::alias_jboss that uses the exported hostname alias to define a utility class that can be exploited to add all jboss instances hostnames in the hosts file of a node.

##Limitations

The module targets Debian and RedHat distributions, including Ubuntu and CentOS. Specifically, it is tested on Ubuntu 12.04 and CentOS 6.6 with 64 bit architecture, although probably it will work also on different versions and on 32 bit architecture.

Furthermore JBoss-7, WildFly-8 and WildFly-12 instances are created in standalone mode.

Due to the fact that JBoss-7, WildFly-8 and WildFly-12 instances need a postconfig phase implemented by calling the jboss-cli.sh script, it is necessary that the instance be up and running at that time. When Puppet just creates the instance in most cases it is not yet ready to accept connections from jboss-cli because the services are still starting. That's no problem because Puppet will complete the configuration (specified in the postconfig phase) at the subsequent run.

##Development

If you need some feature please send me a (pull) request or send me an email at: dsestero 'at' gmail 'dot' com.