wildfly systemd role

Role setting up a systemd service to manage a WildFly app server instance, using basic information on server installation.

Note: default values are based on the one of the wildfly_install role.

Requirements

A working systemd environment is required on target’s system.

Role Defaults

Variable

Description

Default

wildfly_systemd_user

POSIX user account for WildFly service

wildfly

wildfly_systemd_group

POSIX group for WildFly service

{{ wildfly_systemd_user }}

wildfly_systemd_home

WildFly home directory

{{ wildfly_utils_home }}

wildfly_systemd_config_base

Base standalone.xml config for instance

standalone.xml unless wildfly_systemd_config_custom_file is used

wildfly_systemd_config_custom_file

Custom standalone.xml config to be copied to target instance and used as base

''

wildfly_systemd_port_range_offset

Increment for jboss.socket.binding.port-offset

0

wildfly_systemd_unit_enabled

Enable systemd unit to autostart after reboot

True

wildfly_systemd_service_config_location

Path for systemd unit file

/etc/systemd/system

wildfly_systemd_service_config_file_suffix

Systemd unit file extension

.service

wildfly_systemd_conf_file_suffix

Suffix for systemd conf file

.conf

wildfly_systemd_java_home

JAVA_HOME of installed JRE, leave empty for using specified wildfly_systemd_java_package_name RPM path

``

wildfly_systemd_service_config_file_template

Template for systemd unit

templates/wfly.service.j2

wildfly_systemd_service_config_file_template_conf

Template for systemd config

templates/wfly.conf.j2

wildfly_systemd_service_config_file_location

Path for wildfly systemd unit file

/etc/sysconfig

wildfly_systemd_enable_yml_config

Enable yaml file configuration feature (WFCORE5343)

False

wildfly_systemd_yml_configs

List of filenames for wildfly configuration bootstrap

[]

wildfly_systemd_java_package_name

RHEL 10 java rpm package

java-21-openjdk-headless

wildfly_systemd_java_opts

Additional settings for the JVM running wildfly

-Xmx1024M -Xms512M

wildfly_systemd_bind_addr

Bind address for listening to public network

0.0.0.0

wildfly_systemd_bind_addr_private

Bind address for listening to private network

127.0.0.1

wildfly_systemd_bind_addr_management

Bind address for management console port

127.0.0.1

wildfly_systemd_multicast_addr

Multicast address for jgroup cluster discovery

230.0.0.4

wildfly_systemd_statistics_enabled

Whether to enable statistics

False

wildfly_systemd_require_privilege_escalation

Specify if Ansible needs to escalate privilege to interact with Systemd

True

wildfly_systemd_service_name

Systemd unit service name

{{ wildfly_systemd_instance_name }}

wildfly_systemd_instance_name

When collocating services on the same host, instance name

wildfly

wildfly_systemd_node_id

Name of the node to be passed as jboss.tx.node.id, must be unique in a cluster. Max length 23 characters

{{ inventory_hostname_short }}

wildfly_systemd_pidfile_homedir

To change the PID path

/run/{{ wildfly_systemd_instance_name }}

wildfly_systemd_wait_port

The port to wait for when starting up wildfly if wildfly_systemd_wait_for_port is true

9990

wildfly_systemd_startup_message_id

WildFly Message id Identifier for the server startup message

WFLYSRV0025

wildfly_systemd_wait_for_timeout

WildFly instance systemd wait timeout

60

wildfly_systemd_wait_for_delay

WildFly instance systemd delay timeout

10

wildfly_systemd_wait_for_port

Whether systemd unit should wait for wildfly port before returning

False

wildfly_systemd_wait_for_log

Whether systemd unit should wait for wildfly service to be up in logs

False

Role Variables

Variable

Description

Required

wildfly_systemd_java_home

JAVA_HOME of installed JRE, leave empty for using specified wildfly_systemd_java_package_name RPM path

No

wildfly_systemd_yml_configs_repository

Path to the folder containing the YAML config files

True

Example Playbook

  tasks:

    - name: "Set up for WildFly instance {{ item }}"
      include_role:
        name: wildfly_systemd
      vars:
        wildfly_systemd_node_id: "wildfly-{{ item }}"
        wildfly_systemd_instance_name: "wildfly-{{ item }}"
        wildfly_systemd_service_name: "wildfly-{{ item }}-service"
        wildfly_systemd_config_base: standalone-ha.xml
        wildfly_systemd_home: "{{ wildfly_utils_home }}"
        wildfly_systemd_port_range_offset: "{{ item * 100 }}"
      loop: "{{ range(0,3) | list }}"

License

GPL2

Author Information