Defined Type: wildfly::deployment

Defined in:
manifests/deployment.pp

Overview

Manages a deployment (JAR, EAR, WAR) in Wildfly.

This define is a wrapper for `wildfly_deployment` that defaults to your local Wildfly installation.

Parameters:

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

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

  • source (Variant[ Pattern[/^file:\/\//], Pattern[/^puppet:\/\//], Stdlib::Httpsurl, Stdlib::Httpurl ])

    Sets the source for this deployment, either a local file ‘file://` or a remote file `http://`.

  • timeout (Optional[Integer]) (defaults to: undef)

    Sets the timeout to deploy this resource.

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

    Sets the target ‘server-group` for this deployment.

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

    Sets [operation-headers](docs.jboss.org/author/display/WFLY9/Admin+Guide#AdminGuide-OperationHeaders) (e.g. ‘{ ’allow-resource-service-restart’ => true, ‘rollback-on-runtime-failure’ => false, ‘blocking-timeout’ => 600}‘) to be used when creating/destroying this deployment.

  • 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.



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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'manifests/deployment.pp', line 16

define wildfly::deployment (
  Variant[
    Pattern[/^file:\/\//],
    Pattern[/^puppet:\/\//],
    Stdlib::Httpsurl,
    Stdlib::Httpurl
  ]                     $source,
  Enum[present, absent] $ensure            = present,
  Optional[Integer]     $timeout           = undef,
  Optional[String]      $server_group      = undef,
  Hash                  $operation_headers = {},
  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,
) {
  $file_name = basename($source)

  file { "${wildfly::deploy_cache_dir}/${file_name}":
    ensure => 'file',
    owner  => $wildfly::user,
    group  => $wildfly::group,
    mode   => '0655',
    source => $source,
  }

  if $secure {
    $_port = $wildfly::properties['jboss.management.https.port']
  }
  else {
    $_port = $port
  }

  wildfly_deployment { $title:
    ensure            => $ensure,
    server_group      => $server_group,
    username          => $username,
    password          => $password,
    host              => $host,
    port              => $_port,
    secure            => $secure,
    timeout           => $timeout,
    source            => "${wildfly::deploy_cache_dir}/${file_name}",
    operation_headers => $operation_headers,
    require           => [Service['wildfly'], File["${wildfly::deploy_cache_dir}/${file_name}"]],
  }
}