Puppet Class: wildfly

Defined in:
manifests/init.pp

Overview

Main class, includes all other classes.

Parameters:

  • config (Wildfly::Config_file) (defaults to: 'standalone.xml')

    Sets Wildfly configuration file for initialization when you’re using ‘standalone’ mode.

  • conf_file (Optional[Stdlib::Unixpath]) (defaults to: undef)

    Sets a file to be used for service configuration.

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

    Sets a template file for service configuration.

  • console_log (Stdlib::Unixpath) (defaults to: '/var/log/wildfly/console.log')

    Configures service log file.

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

    Sets a custom init script.

  • distribution (Wildfly::Distribution) (defaults to: 'wildfly')

    Sets the Wildfly distribution: ‘wildfly’ or ‘jboss-eap’.

  • dirname (Stdlib::Unixpath) (defaults to: '/opt/wildfly')

    ‘JBOSS_HOME`. i.e. The directory where your Wildfly will live.

  • domain_config (Wildfly::Config_file) (defaults to: 'domain.xml')

    Sets Wildfly configuration file for initialization when you’re using ‘domain’ mode.

  • external_facts (Boolean) (defaults to: false)

    Whether it should deploy external facts.

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

    Sets managed group ID.

  • group (String) (defaults to: 'wildfly')

    Group to own ‘JBOSS_HOME`. If `manage_user` is `true`, this group will be managed.

  • host_config (Wildfly::Config_file) (defaults to: 'host.xml')

    Sets Wildfly Host configuration file for initialization when you’re using ‘domain’ mode.

  • install_cache_dir (Stdlib::Unixpath) (defaults to: '/var/cache/wget')

    The directory to be used for wget cache.

  • deploy_cache_dir (Stdlib::Unixpath) (defaults to: '/opt')

    The directory to be used for deployment cache.

  • install_download_timeout (Integer) (defaults to: 500)

    Sets the timeout for installer download.

  • install_source (Variant[Pattern[/^file:\/\//], Pattern[/^puppet:\/\//], Stdlib::Httpsurl, Stdlib::Httpurl, Undef ]) (defaults to: undef)

    Custom source of Wildfly tarball installer. Defaults to standard Wildfly repositories.

  • java_home (Stdlib::Unixpath) (defaults to: '/usr/java/default')

    Sets the ‘JAVA_HOME` for Wildfly.

  • java_opts (Variant[Undef, String, Array]) (defaults to: undef)

    Sets ‘JAVA_OPTS`, allowing to override several Java params, like `Xmx`, `Xms` and `MaxMetaspaceSize`,

  • java_xmx (String) (defaults to: '512m')

    Sets Java’s ‘-Xmx` parameter.

  • java_xms (String) (defaults to: '256m')

    Sets Java’s ‘-Xms` parameter.

  • java_maxmetaspace_size (String) (defaults to: '128m')

    Sets Java’s ‘-XX:MaxMetaspaceSize` parameter.

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

    Sets ‘JBOSS_OPTS`, allowing to override several JBoss properties. It only works with Wildfly 8.2+.

  • manage_user (Boolean) (defaults to: true)

    Whether this module should manage wildfly user and group.

  • mgmt_user (Struct[{ username => String, password => String }]) (defaults to: { username => 'puppet', password => fqdn_rand_string(30), })

    Hash containing a Wildfly’s management user to be used internally.

  • mgmt_create_keystores (Boolean) (defaults to: true)

    Enables or disables the creation of keystores for TLS enabled ManagementRealm.

  • mgmt_keystore (Stdlib::Unixpath) (defaults to: "${dirname}/${mode}/configuration/mgmt.jks")

    Path to a pre-defined keystore to be used for a TLS enabled ManagementRealm.

  • mgmt_keystore_alias (String) (defaults to: 'mgmt')

    The java keystore ‘alias’ to be used for a TLS enabled ManagementRealm.

  • mgmt_keystore_pass (String) (defaults to: 'changeit')

    The java keystore password to be used for a TLS enabled ManagementRealm.

  • mgmt_ssl_cert (Optional[Stdlib::Unixpath]) (defaults to: undef)

    Path to the certificate used for setting up the ManagementRealm keystore.

  • mgmt_ssl_key (Optional[Stdlib::Unixpath]) (defaults to: undef)

    Path to the private key used for setting up the ManagementRealm keystore.

  • mode (Wildfly::Mode) (defaults to: 'standalone')

    Sets Wildfly execution mode will run, ‘standalone’ or ‘domain’.

  • mode_template (String) (defaults to: "wildfly/${mode}.conf")

    Sets epp template for standalone.conf or domain.conf.

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

    Sets a class to be applied between ‘install’ and ‘setup’ classes.

  • package_ensure (String) (defaults to: 'present')

    Wheter it should manage required packages.

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

    Sets Wildfly package name.

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

    Sets Wildfly package version.

  • properties (Hash[Pattern[/^\w*(\.\w*-?\w*)*$/], String]) (defaults to: { 'jboss.bind.address' => '0.0.0.0', 'jboss.bind.address.management' => '127.0.0.1', 'jboss.management.http.port' => '9990', 'jboss.management.https.port' => '9993', 'jboss.http.port' => '8080', 'jboss.https.port' => '8443', 'jboss.ajp.port' => '8009', })

    Sets properties for your service.

  • remote_debug (Boolean) (defaults to: false)

    Whether remote debug should be enabled.

  • remote_debug_port (Integer) (defaults to: 8787)

    Sets the port to be used by remote debug.

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

    Sets remote username in host config.

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

    Sets the secret value in host config.

  • secure_mgmt_api (Boolean) (defaults to: false)

    Setup and use HTTPS calls to the management API.

  • service_ensure (Boolean) (defaults to: true)

    Sets Wildfly’s service ‘ensure’.

  • service_enable (Boolean) (defaults to: true)

    Sets Wildfly’s service ‘enable’.

  • service_file (Optional[Stdlib::Unixpath]) (defaults to: undef)

    Sets a file to be used for service management.

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

    Sets Wildfly’s service ‘name’.

  • service_manage (Boolean) (defaults to: true)

    Reload Wildfly’s service when changed config.

  • shutdown_wait (Integer) (defaults to: 30)

    Sets the time to wait for the process to be shutdown - sysvinit scripts only.

  • startup_wait (Integer) (defaults to: 30)

    Sets the time to wait for the process to be up - sysvinit scripts only.

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

    Sets a custom systemd template.

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

    Sets managed user ID.

  • user (String) (defaults to: 'wildfly')

    User to own ‘JBOSS_HOME`. If `manage_user` is `true`, this user will be managed.

  • user_home (Stdlib::Unixpath) (defaults to: '/home/wildfly')

    User home directory. Defaults to ‘/home/wildfly’

  • version (Pattern[/^(\d{1,}\.\d{1,}(\.\d{1,})?$)/]) (defaults to: '9.0.2')

    Sets the Wildfly version managed in order to handle small differences among versions.

  • process_controller_java_opts (Variant[Undef, String, Array]) (defaults to: undef)
  • host_controller_java_opts (Variant[Undef, String, Array]) (defaults to: undef)


59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'manifests/init.pp', line 59

class wildfly (
  Pattern[/^(\d{1,}\.\d{1,}(\.\d{1,})?$)/]           $version                      = '9.0.2',
  Variant[Pattern[/^file:\/\//],
    Pattern[/^puppet:\/\//],
    Stdlib::Httpsurl, Stdlib::Httpurl,
    Undef
  ]                                                  $install_source               = undef,
  Wildfly::Distribution                              $distribution                 = 'wildfly',
  Wildfly::Mode                                      $mode                         = 'standalone',
  Stdlib::Unixpath                                   $dirname                      = '/opt/wildfly',
  Stdlib::Unixpath                                   $java_home                    = '/usr/java/default',
  Stdlib::Unixpath                                   $console_log                  = '/var/log/wildfly/console.log',
  Stdlib::Unixpath                                   $install_cache_dir            = '/var/cache/wget',
  Stdlib::Unixpath                                   $deploy_cache_dir             = '/opt',
  Stdlib::Unixpath                                   $mgmt_keystore                = "${dirname}/${mode}/configuration/mgmt.jks",
  Boolean                                            $manage_user                  = true,
  String                                             $user                         = 'wildfly',
  Stdlib::Unixpath                                   $user_home                    = '/home/wildfly',
  String                                             $group                        = 'wildfly',
  String                                             $mode_template                = "wildfly/${mode}.conf",
  String                                             $mgmt_keystore_pass           = 'changeit',
  String                                             $mgmt_keystore_alias          = 'mgmt',
  Wildfly::Config_file                               $config                       = 'standalone.xml',
  Wildfly::Config_file                               $domain_config                = 'domain.xml',
  Wildfly::Config_file                               $host_config                  = 'host.xml',
  String                                             $java_xmx                     = '512m',
  String                                             $java_xms                     = '256m',
  String                                             $java_maxmetaspace_size       = '128m',
  String                                             $package_ensure               = 'present',
  Boolean                                            $service_ensure               = true,
  Boolean                                            $service_manage               = true,
  Boolean                                            $service_enable               = true,
  Boolean                                            $remote_debug                 = false,
  Boolean                                            $external_facts               = false,
  Boolean                                            $secure_mgmt_api              = false,
  Boolean                                            $mgmt_create_keystores        = true,
  Integer                                            $remote_debug_port            = 8787,
  Integer                                            $startup_wait                 = 30,
  Integer                                            $shutdown_wait                = 30,
  Integer                                            $install_download_timeout     = 500,
  Hash[Pattern[/^\w*(\.\w*-?\w*)*$/], String]        $properties                   = {
    'jboss.bind.address' => '0.0.0.0',
    'jboss.bind.address.management' => '127.0.0.1',
    'jboss.management.http.port' => '9990',
    'jboss.management.https.port' => '9993',
    'jboss.http.port' => '8080',
    'jboss.https.port' => '8443',
    'jboss.ajp.port' => '8009',
  },
  Struct[{ username => String, password => String }] $mgmt_user                    = {
    username => 'puppet',
    password => fqdn_rand_string(30),
  },
  Optional[Stdlib::Unixpath]                         $conf_file                    = undef,
  Optional[String]                                   $conf_template                = undef,
  Optional[Stdlib::Unixpath]                         $service_file                 = undef,
  Optional[String]                                   $systemd_template             = undef,
  Optional[String]                                   $service_name                 = undef,
  Optional[String]                                   $custom_init                  = undef,
  Optional[Integer]                                  $uid                          = undef,
  Optional[Integer]                                  $gid                          = undef,
  Optional[String]                                   $secret_value                 = undef,
  Optional[String]                                   $remote_username              = undef,
  Optional[String]                                   $package_name                 = undef,
  Optional[String]                                   $package_version              = undef,
  Variant[Undef, String, Array]                      $java_opts                    = undef,
  Variant[Undef, String, Array]                      $process_controller_java_opts = undef,
  Variant[Undef, String, Array]                      $host_controller_java_opts    = undef,
  Optional[String]                                   $jboss_opts                   = undef,
  Optional[String]                                   $overlay_class                = undef,
  Optional[Stdlib::Unixpath]                         $mgmt_ssl_cert                = undef,
  Optional[Stdlib::Unixpath]                         $mgmt_ssl_key                 = undef,
) {
  contain wildfly::prepare
  contain wildfly::install
  contain wildfly::setup
  contain wildfly::service

  if $overlay_class {
    contain $overlay_class

    Class['wildfly::install']
    -> Class[$overlay_class]
    -> Class['wildfly::setup']
  }

  if $external_facts {
    contain wildfly::external_facts

    Class['wildfly::external_facts']
    -> Class['wildfly::install']
  }

  if $secure_mgmt_api {
    include wildfly::secure_mgmt_api
  }

  Class['wildfly::prepare']
  -> Class['wildfly::install']
  -> Class['wildfly::setup']
  -> Class['wildfly::service']
}