Puppet Class: icingaweb2

Defined in:
manifests/init.pp

Summary

Installs and configures Icinga Web 2.

Overview

Examples:

Use MySQL as backend for user authentication:

include ::mysql::server

mysql::db { 'icingaweb2':
  user     => 'icingaweb2',
  password => 'supersecret',
  host     => 'localhost',
  grant    => [ 'ALL' ],
}

class {'icingaweb2':
  manage_repos  => true,
  import_schema => true,
  db_type       => 'mysql',
  db_host       => 'localhost',
  db_port       => 3306,
  db_username   => 'icingaweb2',
  db_password   => 'supersecret',
  require       => Mysql::Db['icingaweb2'],
}

Use PostgreSQL as backend for user authentication:

include ::postgresql::server

postgresql::server::db { 'icingaweb2':
  user     => 'icingaweb2',
  password => postgresql_password('icingaweb2', 'icingaweb2'),
}

class {'icingaweb2':
  manage_repos  => true,
  import_schema => true,
  db_type       => 'pgsql',
  db_host       => 'localhost',
  db_port       => 5432,
  db_username   => 'icingaweb2',
  db_password   => 'icingaweb2',
  require       => Postgresql::Server::Db['icingaweb2'],
}

Parameters:

  • logging (Enum['file', 'syslog', 'php', 'none']) (defaults to: 'file')

    Whether Icinga Web 2 should log to ‘file’, ‘syslog’ or ‘php’ (web server’s error log). Setting ‘none’ disables logging.

  • logging_file (Stdlib::Absolutepath)

    If ‘logging’ is set to ‘file’, this is the target log file.

  • logging_level (Enum['ERROR', 'WARNING', 'INFO', 'DEBUG']) (defaults to: 'INFO')

    Logging verbosity. Possible values are ‘ERROR’, ‘WARNING’, ‘INFO’ and ‘DEBUG’.

  • logging_facility (Pattern[/user|local[0-7]/]) (defaults to: 'user')

    Logging facility when using syslog. Possible values are ‘user’ or ‘local0’ up to ‘local7’.

  • logging_application (String) (defaults to: 'icingaweb2')

    Logging application name when using syslog.

  • show_stacktraces (Boolean) (defaults to: false)

    Whether to display stacktraces in the web interface or not.

  • module_path (Optional[Variant[ Stdlib::Absolutepath, Array[Stdlib::Absolutepath]]]) (defaults to: undef)

    Additional path to module sources. Multiple paths must be separated by colon.

  • theme (String) (defaults to: 'Icinga')

    The default theme setting. Users may override this settings.

  • theme_disabled (Boolean) (defaults to: false)

    Whether users can change themes or not.

  • manage_repo (Boolean) (defaults to: false)

    Deprecated, use manage_repos.

  • manage_repos (Boolean) (defaults to: false)

    When set to true this module will use the module icinga/puppet-icinga to manage repositories, e.g. the release repo on packages.icinga.com repository by default, the EPEL repository or Backports. For more information, see github.com/icinga/puppet-icinga.

  • manage_package (Boolean) (defaults to: true)

    If set to ‘false` packages aren’t managed.

  • extra_packages (Optional[Array[String]]) (defaults to: undef)

    An array of packages to install additionally.

  • import_schema (Boolean) (defaults to: false)

    Import database scheme. Make sure you have an existing database if you use this option.

  • db_type (Enum['mysql', 'pgsql']) (defaults to: 'mysql')

    Database type, can be either ‘mysql` or `pgsql`. This parameter is only used if `import_schema` is `true` or `config_backend` is `db`.

  • db_host (Stdlib::Host) (defaults to: 'localhost')

    Database hostname. This parameter is only used if ‘import_schema` is `true` or `config_backend` is `db`.

  • db_port (Stdlib::Port) (defaults to: 3306)

    Port of database host. This parameter is only used if ‘import_schema` is `true` or `config_backend` is `db`.

  • db_name (String) (defaults to: 'icingaweb2')

    Database name. This parameter is only used if ‘import_schema` is `true` or `config_backend` is `db`.

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

    Username for database access. This parameter is only used if ‘import_schema` is `true` or `config_backend` is `db`.

  • db_password (Optional[Icingaweb2::Secret]) (defaults to: undef)

    Password for database access. This parameter is only used if ‘import_schema` is `true` or `config_backend` is `db`.

  • config_backend (Enum['ini', 'db']) (defaults to: 'ini')

    The global Icinga Web 2 preferences can either be stored in a database or in ini files. This parameter can either be set to ‘db` or `ini`.

  • conf_user (String)

    By default this module expects Apache2 on the server. You can change the owner of the config files with this parameter.

  • conf_group (String)

    Group membership of config files.

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

    When using domain-aware authentication, you can set a default domain here.

  • cookie_path (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Path to where cookies are stored.

  • admin_role (Variant[Icingaweb2::AdminRole, Boolean[false]])

    Manage a role for admin access.

  • default_admin_username (String)

    Default username for initial admin access. This parameter is only used if ‘import_schema` is set to `true` and only during the import itself.

  • default_admin_password (Icingaweb2::Secret)

    Default password for initial admin access. This parameter is only used if ‘import_schema` is set to `true` and only during the import itself.



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

class icingaweb2 (
  Stdlib::Absolutepath                            $logging_file,
  String                                          $conf_user,
  String                                          $conf_group,
  Variant[Icingaweb2::AdminRole, Boolean[false]]  $admin_role,
  String                                          $default_admin_username,
  Icingaweb2::Secret                              $default_admin_password,
  Optional[Variant[
    Stdlib::Absolutepath,
    Array[Stdlib::Absolutepath]]]                 $module_path         = undef,
  Enum['file', 'syslog', 'php', 'none']           $logging             = 'file',
  Enum['ERROR', 'WARNING', 'INFO', 'DEBUG']       $logging_level       = 'INFO',
  Pattern[/user|local[0-7]/]                      $logging_facility    = 'user',
  String                                          $logging_application = 'icingaweb2',
  Boolean                                         $show_stacktraces    = false,
  String                                          $theme               = 'Icinga',
  Boolean                                         $theme_disabled      = false,
  Boolean                                         $manage_repo         = false,
  Boolean                                         $manage_repos        = false,
  Boolean                                         $manage_package      = true,
  Optional[Array[String]]                         $extra_packages      = undef,
  Boolean                                         $import_schema       = false,
  Enum['mysql', 'pgsql']                          $db_type             = 'mysql',
  Stdlib::Host                                    $db_host             = 'localhost',
  Stdlib::Port                                    $db_port             = 3306,
  String                                          $db_name             = 'icingaweb2',
  Optional[String]                                $db_username         = undef,
  Optional[Icingaweb2::Secret]                    $db_password         = undef,
  Enum['ini', 'db']                               $config_backend      = 'ini',
  Optional[String]                                $default_domain      = undef,
  Optional[Stdlib::Absolutepath]                  $cookie_path         = undef,
) {

  require ::icingaweb2::globals

  if $manage_repos or $manage_repo {
    require ::icinga::repos
    if $manage_repo {
      deprecation('manage_repo', 'manage_repo is deprecated and will be replaced by manage_repos in the future.')
    }
  }

  class { '::icingaweb2::install': }
  -> class { '::icingaweb2::config': }

  contain ::icingaweb2::install
  contain ::icingaweb2::config

}