Puppet Class: maestro::maestro

Inherits:
maestro::params
Defined in:
manifests/maestro.pp

Overview

This class is used to install and configure the Maestro server.

Note that admin_password needs to validate against the password rules (letters+numbers by default)

Parameters

repo

A hash containing the artifact repository URL and credentials.

version

The version to install

package_type

Selects the type of package to use for the install. Either rpm, or tarball.

ldap

A hash containing the LDAP connection parameters. hostname, ssl, port, dn, bind_dn, bind_password, admin_user

enabled

Enables/disables the service

lucee

Set to true to install lucee locally.

admin

the maestro admin user

admin_password

the maestro admin user password

master_password

the master password

db_server_password

DEPRECATED the database server password

db_password

DEPRECATED the database user password

db_version

DEPRECATED the PostgreSQL version.

db_allowed_rules

DEPRECATED an array used to configure PostgreSQL access control.

initmemory

configures the initial memory for the JVM running Maestro

maxmemory

configures the max memory for the JVM running Maestro

permsize

configures the initial permsize for the JVM running Maestro

maxpermsize

configures the max permsize for the JVM running Maestro

port

the port maestro should be configured to listen on.

lucee_url

the URL for the LUCEE API

lucee_password

DEPRECATED the lucee user password

lucee_username

DEPRECATED the lucee user name

jetty_forwarded

set to true to indicate that jetty is being forwarded by a proxy.

mail_from

A hash containing the origin information for emails sent by maestro. name, address.

enable_jpda

A boolean indicating whether or not we want to enable JPDA

jmxport

The port number the JMX server will listen on (default 9001)

rmi_server_hostname

The ip address the JMX server will listen on (default $ipaddress)

web_config_properties

properties to add the maestro.properties, such as a feature toggles

ga_property_id

the google analytics property id

Parameters:

  • repo (Any) (defaults to: $maestro::params::repo)
  • version (Any) (defaults to: 'present')
  • package_type (Any) (defaults to: 'rpm')
  • ldap (Any) (defaults to: {})
  • enabled (Any) (defaults to: undef)
  • lucee (Any) (defaults to: true)
  • metrics_enabled (Any) (defaults to: false)
  • admin (Any) (defaults to: undef)
  • admin_password (Any) (defaults to: undef)
  • master_password (Any) (defaults to: $maestro_master_password)
  • db_server_password (Any) (defaults to: undef)
  • db_password (Any) (defaults to: undef)
  • jdbc_maestro (Any) (defaults to: { url => "jdbc:postgresql://${maestro::params::db_host}:${maestro::params::db_port}/maestro", driver => "org.postgresql.Driver", username => $maestro::params::db_username, })
  • jdbc_users (Any) (defaults to: { url => "jdbc:postgresql://${maestro::params::db_host}:${maestro::params::db_port}/maestro", driver => "org.postgresql.Driver", username => $maestro::params::db_username, })
  • db_version (Any) (defaults to: undef)
  • db_allowed_rules (Any) (defaults to: undef)
  • initmemory (Any) (defaults to: undef)
  • maxmemory (Any) (defaults to: undef)
  • permsize (Any) (defaults to: undef)
  • maxpermsize (Any) (defaults to: undef)
  • port (Any) (defaults to: '8080')
  • agent_auto_activate (Any) (defaults to: false)
  • enable_jpda (Any) (defaults to: false)
  • jmxport (Any) (defaults to: '9001')
  • rmi_server_hostname (Any) (defaults to: 'localhost')
  • lucee_url (Any) (defaults to: 'http://localhost:8080/lucee/api/v0/')
  • lucee_password (Any) (defaults to: undef)
  • lucee_username (Any) (defaults to: undef)
  • jetty_forwarded (Any) (defaults to: $::jetty_forwarded)
  • maestro_context_path (Any) (defaults to: "/")
  • lucee_context_path (Any) (defaults to: "/lucee")
  • mail_from (Any) (defaults to: { name => 'Maestro', address => 'info@maestrodev.com' })
  • web_config_properties (Any) (defaults to: {})
  • ga_property_id (Any) (defaults to: '')
  • logging_level (Any) (defaults to: $maestro::params::logging_level)


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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'manifests/maestro.pp', line 36

class maestro::maestro(
  $repo = $maestro::params::repo,
  $version = 'present',
  $package_type = 'rpm',
  $ldap = {},
  $enabled = undef,
  $lucee = true,
  $metrics_enabled = false,
  $admin = undef, # deprecated
  $admin_password = undef, # deprecated
  $master_password = $maestro_master_password,
  $db_server_password = undef, # deprecated
  $db_password = undef, # deprecated
  $jdbc_maestro = {
    url => "jdbc:postgresql://${maestro::params::db_host}:${maestro::params::db_port}/maestro",
    driver => "org.postgresql.Driver",
    username => $maestro::params::db_username,
  },
  $jdbc_users = {
    url => "jdbc:postgresql://${maestro::params::db_host}:${maestro::params::db_port}/maestro",
    driver => "org.postgresql.Driver",
    username => $maestro::params::db_username,
  },
  $db_version = undef, # deprecated
  $db_allowed_rules = undef, # deprecated
  $initmemory = undef,
  $maxmemory = undef,
  $permsize = undef,
  $maxpermsize = undef,
  $port = '8080',
  $agent_auto_activate = false,
  $enable_jpda = false,
  $jmxport = '9001',
  $rmi_server_hostname = 'localhost',
  $lucee_url = 'http://localhost:8080/lucee/api/v0/',
  $lucee_password = undef, # deprecated
  $lucee_username = undef, # deprecated
  $jetty_forwarded = $::jetty_forwarded,
  $maestro_context_path = "/",
  $lucee_context_path = "/lucee",
  $mail_from = {
    name    => 'Maestro',
    address => 'info@maestrodev.com'
  },
  $web_config_properties = {},
  $ga_property_id = '',
  $logging_level = $maestro::params::logging_level) inherits maestro::params {

  $installdir = '/usr/local'
  $basedir = $maestro::params::user_home
  $homedir = '/usr/local/maestro'


  File {
    owner => $maestro::params::user,
    group => $maestro::params::group,
  }

  # Deprecate a number of variables moved to params
  if $enabled != undef {
    warning("maestro::maestro::enabled is deprecated and ignored, use maestro::params::enabled")
  }
  if $db_version != undef {
    warning("maestro::maestro::db_version is deprecated, use maestro::params::db_version")
  }
  if $db_server_password != undef {
    warning("maestro::maestro::db_server_password is deprecated, use maestro::params::db_server_password")
  }
  if $db_password != undef {
    warning("maestro::maestro::db_password is deprecated, use maestro::params::db_password")
  }
  if $db_allowed_rules != undef {
    warning("maestro::maestro::db_allowed_rules is deprecated, use maestro::params::db_allowed_rules")
  }
  if $lucee_username != undef {
    warning("maestro::maestro::lucee_username is deprecated, use maestro::params::lucee_username")
  }
  if $lucee_password != undef {
    warning("maestro::maestro::lucee_password is deprecated, use maestro::params::lucee_password")
  }
  if $admin != undef {
    warning("maestro::maestro::admin is deprecated, use maestro::params::admin_username")
  }
  if $admin_password != undef {
    warning("maestro::maestro::admin_password is deprecated, use maestro::params::admin_password")
  }

  # Create user and group

  if ! defined(User[$maestro::params::user]) {
    user { $user:
      ensure     => present,
      home       => $maestro::params::user_home,
      managehome => true,
      shell      => '/bin/bash',
      system     => true,
      gid        => $maestro::params::group,
      require    => Group[$maestro::params::group],
    }
  }

  if ! defined(Group[$maestro::params::group]) {
    group { $maestro::params::group:
      ensure => present,
      system => true,
    }
  }


  # Create the basedir. Where config and logs belong for this
  # particular maestro instance.

  # not needed in Maestro 4.18.0+ RPM
  if ($maestro::maestro::package_type == 'tarball') or (versioncmp($maestro::maestro::version, '4.18.0') < 0) {
    file { $basedir:
      ensure => directory,
    } ->
    file { "${basedir}/conf":
      ensure => directory,
    } ->
    file { "${basedir}/logs":
      ensure => directory,
    } ->
    file { "${basedir}/tmp":
      ensure => directory,
    }
  }

  $base_version = snapshotbaseversion($version)

  if $lucee {
    # For maestro versions older than 4.12.0 we need some more packages
    if versioncmp($version, '4.12.0') < 0 {
      ensure_packages(['libxslt-devel', 'libxml2-devel'])
      Package['libxslt-devel'] -> Class['maestro::lucee']
      Package['libxml2-devel'] -> Class['maestro::lucee']
    }

    class { 'maestro::lucee':
      config_dir          => "${basedir}/conf",
      agent_auto_activate => $agent_auto_activate,
      password            => $db_password,
      before              => Service['maestro'],
      metrics_enabled     => $metrics_enabled,
      lucee_username      => $lucee_username ? {undef => undef, default => $lucee_username},
      lucee_password      => $lucee_password ? {undef => undef, default => $lucee_password},
    }

    # plugin folder
    file { "${user_home}/.maestro" :
      ensure  => directory,
      require => Anchor['maestro::maestro::package::end'],
    } ->
    file { "${user_home}/.maestro/plugins" :
      ensure => directory,
    }
  }

  class { 'maestro::maestro::db':
    version         => $db_version ? {undef => undef, default => $db_version},
    password        => $db_server_password ? {undef => undef, default => $db_server_password},
    db_password     => $db_password ? {undef => undef, default => $db_password},
    allowed_rules   => $db_allowed_rules ? {undef => undef, default => $db_allowed_rules},
  } ->
  class { 'maestro::maestro::package': } ->
  class { 'maestro::maestro::securityconfig': } ->
  class { 'maestro::maestro::config':
    db_version         => $db_version ? {undef => undef, default => $db_version},
    db_server_password => $db_server_password ? {undef => undef, default => $db_server_password},
    db_password        => $db_password ? {undef => undef, default => $db_password},
    db_allowed_rules   => $db_allowed_rules ? {undef => undef, default => $db_allowed_rules},
    admin              => $admin ? {undef => undef, default => $admin},
    admin_password     => $admin_password ? {undef => undef, default => $admin_password},
    lucee_username     => $lucee_username ? {undef => undef, default => $lucee_username},
    lucee_password     => $lucee_password ? {undef => undef, default => $lucee_password},
    logging_level      => $logging_level,
  } ->
  class { 'maestro::maestro::service': }

}