Defined Type: wildfly::cli

Defined in:
manifests/cli.pp

Overview

Executes an arbitrary JBoss-CLI command

`[node-type=node-name (/node-type=node-name)*] : operation-name ['('[name=value [, name=value]*]')'] [{header (;header)*}]`.
This define is a wrapper for `wildfly_cli` that defaults to your local Wildfly installation.

Parameters:

  • command (String) (defaults to: $title)

    The actual command to execute.

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

    If this parameter is set, then this ‘cli` will only run if this command condition is met.

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

    If this parameter is set, then this ‘cli` will run unless this command condition is met.

  • username (String) (defaults to: $wildfly::mgmt_user['username'])

    Wildfly’s management user to be used internally.

  • password (String) (defaults to: $wildfly::mgmt_user['password'])

    The password for Wildfly’s management user.

  • host (String) (defaults to: $wildfly::properties['jboss.bind.address.management'])

    The IP address or FQDN of the JBoss Management service.

  • port (String) (defaults to: $wildfly::properties['jboss.management.http.port'])

    The port of the JBoss Management service.

  • secure (Boolean) (defaults to: $wildfly::secure_mgmt_api)

    Use https port or http port.

  • refreshonly (Optional[Boolean]) (defaults to: undef)


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
# File 'manifests/cli.pp', line 15

define wildfly::cli (
  String            $command     = $title,
  Optional[String]  $unless      = undef,
  Optional[String]  $onlyif      = undef,
  Optional[Boolean] $refreshonly = undef,
  String            $username    = $wildfly::mgmt_user['username'],
  String            $password    = $wildfly::mgmt_user['password'],
  String            $host        = $wildfly::properties['jboss.bind.address.management'],
  String            $port        = $wildfly::properties['jboss.management.http.port'],
  Boolean           $secure      = $wildfly::secure_mgmt_api,
) {
  if $secure {
    $_port  = $wildfly::properties['jboss.management.https.port']
  }
  else {
    $_port = $port
  }

  wildfly_cli { $title:
    command     => $command,
    username    => $username,
    password    => $password,
    host        => $host,
    port        => $_port,
    secure      => $secure,
    unless      => $unless,
    onlyif      => $onlyif,
    refreshonly => $refreshonly,
    require     => Service['wildfly'],
  }
}