Defined Type: jboss::clientry

Defined in:
manifests/clientry.pp

Overview

Define: jboss::clientry

This define is very versitale. 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.

Parameters:

This type uses *JBoss module standard metaparameters*

ensure

Standard ensure parameter. Can be either ‘present` or `absent`.

path

This is the namevar. Path of the CLI entry. This is path accepted by JBoss CLI. The path must be passed without ‘/profile=<profile-name>` in domain mode as well (for that `profile` parameter must be used).

properties

This is optional properties hash. You can pass any valid JBoss properties for given ‘path`. For valid ones head to the JBoss Application Server documentation. Must be hash object or `undef` value.

dorestart

This parameter forces to execute command ‘:restart()` on this CLI entry.

Parameters:

  • ensure (Any) (defaults to: 'present')
  • path (Any) (defaults to: $name)
  • properties (Any) (defaults to: undef)
  • profile (Any) (defaults to: $::jboss::profile)
  • controller (Any) (defaults to: $::jboss::controller)
  • runasdomain (Any) (defaults to: $::jboss::runasdomain)
  • dorestart (Any) (defaults to: true)


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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'manifests/clientry.pp', line 21

define jboss::clientry (
  $ensure      = 'present',
  $path        = $name,
  $properties  = undef,
  $profile     = $::jboss::profile,
  $controller  = $::jboss::controller,
  $runasdomain = $::jboss::runasdomain,
  $dorestart   = true,
) {
  include jboss
  include jboss::internal::service
  include jboss::internal::runtime::node

  case $ensure {
    'running':  {}
    'stopped':  {}
    'absent':   {}
    'present':  {}
    'enabled':  {}
    'disabled': {}
    default:   {
      fail("Invalid value for ensure: `${ensure}`. Supported values are: `present`, `absent`, `running`, `stopped`, `enabled`, `disabled`")
    }
  }

  jboss_confignode { $name:
    ensure      => $ensure,
    path        => $path,
    properties  => $properties,
    controller  => $controller,
    ctrluser    => $jboss::internal::runtime::node::username,
    ctrlpasswd  => $jboss::internal::runtime::node::password,
    profile     => $profile,
    runasdomain => $runasdomain,
    require     => Anchor['jboss::package::end'],
  }

  if str2bool($::jboss_running) {
    Jboss_confignode[$name] ~> Service[$jboss::internal::service::servicename]
  } else {
    Anchor['jboss::service::end'] -> Jboss_confignode[$name]
  }

  if $dorestart {
    if !$::jboss::runasdomain {
      Jboss_confignode[$name] ~> Exec['jboss::service::restart']
    }
  }

}