Defined Type: wildfly::domain::server_group

Defined in:
manifests/domain/server_group.pp

Overview

Manages a domain server group.

Parameters:

  • ensure (Enum[present, absent]) (defaults to: present)

    Whether the resource should exist (`present`) or not (`absent`).

  • profile (Optional[String]) (defaults to: undef)

    Sets profile referenced by the server-group.

  • socket_binding_group (Optional[String]) (defaults to: undef)

    Sets socket-binding-group referenced by the server-group.

  • socket_binding_group_offset

    Sets socket-binding-port-offset server-config port offset.

  • jvm_name (String) (defaults to: 'default')

    Sets jvm name configured to the server-group.

  • jvm_config (Hash) (defaults to: {})

    Sets jvm configurations like “, “ etc.

  • socket_binding_port_offset (Integer) (defaults to: 0)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'manifests/domain/server_group.pp', line 10

define wildfly::domain::server_group(
  Enum[present, absent] $ensure          = present,
  Optional[String] $profile              = undef,
  Optional[String] $socket_binding_group = undef,
  Integer $socket_binding_port_offset    = 0,
  String $jvm_name                       = 'default',
  Hash $jvm_config                       = {},
) {
  require wildfly::install

  $server_group_name = $title

  if $ensure == present {
    if empty($profile) {
      fail('profile is required')
    }

    if empty($socket_binding_group) {
      fail('socket_binding_group is required')
    }

    wildfly::resource { "/server-group=${server_group_name}":
      content => {
        'profile'                    => $profile,
        'socket-binding-group'       => $socket_binding_group,
        'socket-binding-port-offset' => $socket_binding_port_offset,
      },
    }
    -> wildfly::resource { "/server-group=${server_group_name}/jvm=${jvm_name}" :
      content => $jvm_config,
    }
  } elsif $ensure == absent {
    wildfly::resource { "/server-group=${server_group_name}" :
      ensure => absent,
    }
  }
}