diff --git a/.yardoc/checksums b/.yardoc/checksums index fd75963..0bbebce 100644 --- a/.yardoc/checksums +++ b/.yardoc/checksums @@ -1,33 +1,33 @@ manifests/init.pp 6e8dc19d52ffcca0b7a4430fe02fa2bc4de26231 manifests/repo.pp 56f4188f0115e9c1339cc7272009c93ff2879eec manifests/config.pp f1870305c087047839902c757d2a0a718511bf3f -manifests/module.pp 51f017bf832ab28f0d7d36c36c85e47a833c0478 +manifests/module.pp c31e3596723581fe47f9a70819c98ed2098c4f69 manifests/globals.pp 68963b054797a17ab5775c8d853c914aec96998f manifests/install.pp b4ea88126f3dab2ad514a41cc271fa0d41fef3b9 manifests/inisection.pp 0d2c69f45ecd5afb40a2e4b5956c017be66ec008 manifests/module/doc.pp e07bd49cb95a60330545e86d91d937a0173d9ae0 -manifests/module/ipl.pp 5991ec24317cdb68993d36c39c25559ef1a3d290 +manifests/module/ipl.pp b51c9c3dc753edb69fbb0b20ae37a00e60afca18 manifests/config/role.pp 2995727b3a144a9ea80f51c179e618059a346545 -manifests/module/cube.pp de9fa5838408773b0c49f8905e9fb41031dae2ea -manifests/module/vsphere.pp d652e6ff3e018c238e0834831a51b4c241ba8f60 +manifests/module/cube.pp 82663fe888fd3d185e8cf1e260705f4c10566794 +manifests/module/vsphere.pp efdedbe2490a8119693d858648e8be7578298e14 manifests/config/resource.pp 32bebb3f8521dfe2850534e2a5406d9c55329db6 -manifests/module/director.pp b6638f0afdf73cc00b78f49b077a6f7962809eab -manifests/module/graphite.pp 86bd2792f23950923b0dc1a47a474b68b7f30ff9 -manifests/module/puppetdb.pp 3182fb39800d1b72cad87a336537e97059bd7a31 -manifests/module/incubator.pp a813fd102263d842ae1b4f53906831c0a06f8262 +manifests/module/director.pp 394a92176dd6135395c0c532f0a9af8f41bd6e0a +manifests/module/graphite.pp e1dc0cd7a53b009cffeb51e7cdf0d14870b99bb9 +manifests/module/puppetdb.pp 75ac74be43c067f70eee1b8d77a8c1e6eec81c12 +manifests/module/incubator.pp 5bc91db2356fa3ca850b0d3b4371d4870bbd37cb manifests/config/authmethod.pp 9e0b6915f702a44bf1233ee3b0c5336e391eda67 -manifests/module/generictts.pp 992be83c98a019b7698f89383de45fcd3371215c -manifests/module/monitoring.pp d05724b888e17bccafc5b8648258ace33b8097b5 -manifests/module/fileshipper.pp 491b15d3cfd663c4a098f3d6018fc834c078a733 -manifests/module/reactbundle.pp 30965ec0b165a4efae580e1135b0b2466f7dc90d -manifests/module/translation.pp fba8e5f1b222abf8874b5c30523255f5e6a842ab +manifests/module/generictts.pp 3d56c11584138a62c4c24aa3daee34a6894b5a78 +manifests/module/monitoring.pp 202d7a19de736b676279d5bd9ec15cd46a5bf24c +manifests/module/fileshipper.pp 6e0631b442e952f7d5f8a9783ae28439f4b60d19 +manifests/module/reactbundle.pp 5063f51e0c34c81e421521c382b938c65d7571d1 +manifests/module/translation.pp 548098f9c313d5e250aeddde3d77c10d32dee2cf manifests/config/groupbackend.pp cc8ec28028235be052656ba4c2521f4b4764d1ed -manifests/module/elasticsearch.pp 2054ea3fad14345fe62b4610feb5ca8cd78a971f -manifests/module/businessprocess.pp ff6144073fb3d915550964d6242e36897f42d3b1 +manifests/module/elasticsearch.pp 91d36f25a2296ce04621a355600c5759cd4c7aab +manifests/module/businessprocess.pp 6c78294ea1d97b4c5d92387df16b1cddbfdd8c64 manifests/module/fileshipper/basedir.pp 88bfb57c6e817e21f592f7ee87d7b851c12ee842 manifests/module/puppetdb/certificate.pp c78929b7a204e7ff0768e1c8d04296a65f5f3cf1 manifests/module/fileshipper/directory.pp 83368dbbe111e98fec0964873984f31dd68d55fb -manifests/module/elasticsearch/instance.pp a94b4e6d2b374b35b7d56d7bf77b80c36358f4fc -manifests/module/elasticsearch/eventtype.pp e901a89e2c88212ab687a2085f0bc4ef34b8dae5 +manifests/module/elasticsearch/instance.pp 18dab274d68c12ba957160a7cdda3f6a0308b92e +manifests/module/elasticsearch/eventtype.pp 6815b2d7e8235ff15264180261280ee7fb0a1f56 manifests/module/generictts/ticketsystem.pp a3d4f27b125dd15f7b9dafdd64790087079596a0 manifests/module/monitoring/commandtransport.pp 73ec97547eb1bedaaf21bc62cd275eeb814da2d7 diff --git a/.yardoc/objects/root.dat b/.yardoc/objects/root.dat index 54fa28d..182131b 100644 Binary files a/.yardoc/objects/root.dat and b/.yardoc/objects/root.dat differ diff --git a/README.md b/README.md index 37557e1..689b4a5 100644 --- a/README.md +++ b/README.md @@ -1,235 +1,238 @@ [![Build Status](https://travis-ci.org/Icinga/puppet-icingaweb2.png?branch=master)](https://travis-ci.org/Icinga/puppet-icingaweb2) # Icinga Web 2 Puppet Module #### Table of Contents 1. [Overview](#overview) 2. [Module Description - What the module does and why it is useful](#module-description) 3. [Setup - The basics of getting started with Icinga Web 2](#setup) * [What Icinga Web 2 affects](#what-icinga-web-2-affects) 4. [Usage - Configuration options and additional functionality](#usage) 5. [Reference](#reference) 6. [Development - Guide for contributing to the module](#development) ## Overview [Icinga Web 2] is the associated web interface for the open source monitoring tool [Icinga 2]. This module helps with installing and managing configuration of Icinga Web 2 and its modules on multiple operating systems. ### Description This module installs and configures Icinga Web 2 on your Linux host by using the official packages from [packages.icinga.com]. Dependend packages are installed as they are defined in the Icinga Web 2 package. This module can manage all configurations files of Icinga Web 2 and import an initial database schema. It can install and manage all official [modules](https://www.icinga.com/products/icinga-web-2-modules/) as well as modules developed by the community. ## Setup ### What the Icinga 2 Puppet module supports * Installation of Icinga Web 2 via packages * Configuration * MySQL / PostgreSQL database schema import * Install and manage official Icinga Web 2 modules * Install community modules ### Dependencies This module depends on * [puppetlabs/stdlib] >= 4.16.0 * [puppetlabs/vcsrepo] >= 1.3.0 * [puppetlabs/concat] >= 2.0.1 Depending on your setup the following modules may also be required: * [puppetlabs/apt] >= 2.0.0 * [puppetlabs/yumrepo_core] >= 1.0.0 * [puppet/zypprepo] >= 2.0.0 ### Limitations This module has been tested on: * Debian 9, 10 * CentOS/RHEL 6, 7 * Requires [Software Collections Repository](https://wiki.centos.org/AdditionalResources/Repositories/SCL) * Ubuntu 16.04, 18.04 * SLES 12 * PHP >= 7.0 Other operating systems or versions may work but have not been tested. ## Usage +NOTE: If you plan to use additional modules from git, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in `extra_packages`. + The usage of this module isn't simple. That depends on how Icinga Web 2 is implemented. Monitoring is here just a module in a framework. All basic stuff like authentication, logging or authorization is done by this framework. To store user and usergroups in a MySQL database, the database has to exist: ``` mysql::db { 'icingaweb2': user => 'icingaweb2', password => 'supersecret', host => 'localhost', grant => [ 'ALL' ], } class {'icingaweb2': manage_repo => true, import_schema => true, db_type => 'mysql', db_host => 'localhost', db_port => 3306, db_username => 'icingaweb2', db_password => 'supersecret', config_backend => 'db', + extra_packages => [ 'git' ], require => Mysql::Db['icingaweb2'], } ``` If you set `import_schema` to `true` an default admin user `icingaadmin` with password `icinga` will be created automatically and you're allowed to login. In case that `import_schema` is disabled or you'd like to use a different backend for authorization like LDAP, more work is required. At first we need a ressource with credentials to connect a LDAP server: ``` class {'icingaweb2': manage_repo => true, } icingaweb2::config::resource{ 'my-ldap': type => 'ldap', host => 'localhost', port => 389, ldap_root_dn => 'ou=users,dc=icinga,dc=com', ldap_bind_dn => 'cn=icingaweb2,ou=users,dc=icinga,dc=com', ldap_bind_pw => 'supersecret', } ``` With the help of this resource, we are now creating user and group backends. Users are permitted to login and users and groups will later be used for authorization. ``` icingaweb2::config::authmethod { 'ldap-auth': backend => 'ldap', resource => 'my-ldap', ldap_user_class => 'user', ldap_filter => '(memberof:1.2.840.113556.1.4.1941:=CN=monitoring,OU=groups,DC=icinga,DC=com)', ldap_user_name_attribute => 'cn', order => '05', } icingaweb2::config::groupbackend { 'ldap-groups': backend => 'ldap', resource => 'my-ldap', ldap_group_class => 'group', ldap_group_name_attribute => 'cn', ldap_group_member_attribute => 'member', ldap_base_dn => 'ou=groups,dc=icinga,dc=com', domain => 'icinga.com', } ``` So that a group gets admin rights a role has to manage: ``` icingaweb2::config::role { 'default admin user': groups => 'icingaadmins', permissions => '*', } ``` All available permissions for module monitoring are listed below: | Description | Value | |-------------|-------| | Allow everything | `*` | | Allow to share navigation items | `application/share/navigation` | | Allow to adjust in the preferences whether to show stacktraces | `application/stacktraces` | | Allow to view the application log | `application/log` | | Grant admin permissions, e.g. manage announcements | `admin` | | Allow config access | `config/*` | | Allow access to module doc | `module/doc` | | Allow access to module monitoring | `module/monitoring` | | Allow all commands | `monitoring/command/*` | | Allow scheduling host and service checks | `monitoring/command/schedule-check` | | Allow acknowledging host and service problems | `monitoring/command/acknowledge-problem` | | Allow removing problem acknowledgements | `monitoring/command/remove-acknowledgement` | | Allow adding and deleting host and service comments | `monitoring/command/comment/*` | | Allow commenting on hosts and services | `monitoring/command/comment/add` | | Allow deleting host and service comments | `monitoring/command/comment/delete` | | Allow scheduling and deleting host and service downtimes | `monitoring/command/downtime/*` | | Allow scheduling host and service downtimes | `monitoring/command/downtime/schedule` | | Allow deleting host and service downtimes | `monitoring/command/downtime/delete` | | Allow processing host and service check results | `monitoring/command/process-check-result` | | Allow processing commands for toggling features on an instance-wide basis | `monitoring/command/feature/instance` | | Allow processing commands for toggling features on host and service objects | `monitoring/command/feature/object/*`) | | Allow processing commands for toggling active checks on host and service objects | `monitoring/command/feature/object/active-checks` | | Allow processing commands for toggling passive checks on host and service objects | `monitoring/command/feature/object/passive-checks` | | Allow processing commands for toggling notifications on host and service objects | `monitoring/command/feature/object/notifications` | | Allow processing commands for toggling event handlers on host and service objects | `monitoring/command/feature/object/event-handler` | | Allow processing commands for toggling flap detection on host and service objects | `monitoring/command/feature/object/flap-detection` | | Allow sending custom notifications for hosts and services | `monitoring/command/send-custom-notification` | | Allow access to module setup | `module/setup` | | Allow access to module test | `module/test` | | Allow access to module translation | `module/translation` | Finally we configure the monitoring with the needed connection to the IDO to get information and an API user to send commands to Icinga 2: ``` class {'icingaweb2::module::monitoring': ido_host => 'localhost', ido_db_type => 'mysql', ido_db_name => 'icinga2', ido_db_username => 'icinga2', ido_db_password => 'supersecret', commandtransports => { icinga2 => { transport => 'api', username => 'icingaweb2', password => 'supersecret', } } } ``` ## Reference See [REFERENCE.md](https://github.com/Icinga/puppet-icingaweb2/blob/master/REFERENCE.md) ## Development A roadmap of this project is located at https://github.com/Icinga/puppet-icingaweb2/milestones. Please consider this roadmap when you start contributing to the project. ### Contributing When contributing several steps such as pull requests and proper testing implementations are required. Find a detailed step by step guide in [CONTRIBUTING.md]. ### Testing Testing is essential in our workflow to ensure a good quality. We use RSpec as well as Serverspec to test all components of this module. For a detailed description see [TESTING.md]. ### Release Notes When releasing new versions we refer to [SemVer 1.0.0] for version numbers. All steps required when creating a new release are described in [RELEASE.md] See also [CHANGELOG.md] ### Authors [AUTHORS] is generated on each release. [Icinga 2]: https://www.icinga.com/products/icinga-2/ [Icinga Web 2]: https://www.icinga.com/products/icinga-web-2/ [puppetlabs/apt]: https://github.com/puppetlabs/puppetlabs-apt [puppetlabs/yumrepo_core]: https://github.com/puppetlabs/puppetlabs-yumrepo_core [puppet/zypprepo]: https://forge.puppet.com/puppet/zypprepo [puppetlabs/stdlib]: https://github.com/puppetlabs/puppetlabs-stdlib [puppetlabs/concat]: https://github.com/puppetlabs/puppetlabs-concat [puppetlabs/vcsrepo]: https://forge.puppet.com/puppetlabs/vcsrepo [puppetlabs/mysql]: https://github.com/puppetlabs/puppetlabs-mysql [puppetlabs/puppetlabs-postgresql]: https://github.com/puppetlabs/puppetlabs-postgresql [packages.icinga.com]: https://packages.icinga.com [CHANGELOG.md]: CHANGELOG.md [AUTHORS]: AUTHORS [RELEASE.md]: RELEASE.md [TESTING.md]: TESTING.md [CONTRIBUTING.md]: CONTRIBUTING.md diff --git a/REFERENCE.md b/REFERENCE.md index 1e6dae6..49f8a13 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -1,1871 +1,1885 @@ # Reference ## Table of Contents **Classes** _Public Classes_ * [`icingaweb2`](#icingaweb2): Installs and configures Icinga Web 2. * [`icingaweb2::globals`](#icingaweb2globals): This class loads the default parameters by doing a hiera lookup. * [`icingaweb2::module::businessprocess`](#icingaweb2modulebusinessprocess): Installs and enables the businessprocess module. * [`icingaweb2::module::cube`](#icingaweb2modulecube): Installs and enables the cube module. * [`icingaweb2::module::director`](#icingaweb2moduledirector): Installs and configures the director module. * [`icingaweb2::module::doc`](#icingaweb2moduledoc): The doc module provides an interface to the Icinga 2 and Icinga Web 2 documentation. * [`icingaweb2::module::elasticsearch`](#icingaweb2moduleelasticsearch): The Elasticsearch module displays events from data stored in Elasticsearch. * [`icingaweb2::module::fileshipper`](#icingaweb2modulefileshipper): The fileshipper module extends the Director. It offers import sources to deal with CSV, JSON, YAML and XML files. * [`icingaweb2::module::generictts`](#icingaweb2modulegenerictts): Installs and enables the generictts module. * [`icingaweb2::module::graphite`](#icingaweb2modulegraphite): The Graphite module draws graphs out of time series data stored in Graphite. * [`icingaweb2::module::incubator`](#icingaweb2moduleincubator): Installs and enables the incubator module. * [`icingaweb2::module::ipl`](#icingaweb2moduleipl): Installs and enables the ipl module. * [`icingaweb2::module::monitoring`](#icingaweb2modulemonitoring): Manages the monitoring module. This module is mandatory for probably every setup. * [`icingaweb2::module::puppetdb`](#icingaweb2modulepuppetdb): Installs and configures the puppetdb module. * [`icingaweb2::module::reactbundle`](#icingaweb2modulereactbundle): Installs and enables the reactbundle module. * [`icingaweb2::module::translation`](#icingaweb2moduletranslation): Installs and configures the translation module. * [`icingaweb2::module::vsphere`](#icingaweb2modulevsphere): The vSphere module extends the Director. It provides import sources for virtual machines and physical hosts from vSphere. _Private Classes_ * `icingaweb2::config`: Configures Icinga Web 2. * `icingaweb2::install`: Installs Icinga Web 2 and extra packages. * `icingaweb2::repo`: Manages the packages.icinga.com repository based on the operating system. **Defined types** _Public Defined types_ * [`icingaweb2::config::authmethod`](#icingaweb2configauthmethod): Manage Icinga Web 2 authentication methods. Auth methods may be chained by setting proper ordering. * [`icingaweb2::config::groupbackend`](#icingaweb2configgroupbackend): Groups of users can be stored either in a database, LDAP or ActiveDirectory. This defined type configures backends that store groups. * [`icingaweb2::config::resource`](#icingaweb2configresource): Create and remove Icinga Web 2 resources. Resources may be referenced in other configuration sections. * [`icingaweb2::config::role`](#icingaweb2configrole): Roles define a set of permissions that may be applied to users or groups. * [`icingaweb2::inisection`](#icingaweb2inisection): Manage settings in INI configuration files. * [`icingaweb2::module`](#icingaweb2module): Download, enable and configure Icinga Web 2 modules. _Private Defined types_ * `icingaweb2::module::elasticsearch::eventtype`: Manages an Elasticsearch event types * `icingaweb2::module::elasticsearch::instance`: Manages an Elasticsearch instance * `icingaweb2::module::fileshipper::basedir`: Manages base directories for the fileshipper module. * `icingaweb2::module::fileshipper::directory`: Manages directories with plain Icinga 2 configuration files. * `icingaweb2::module::generictts::ticketsystem`: Manages ticketsystem configuration for the generictts module. * `icingaweb2::module::monitoring::commandtransport`: Manages commandtransport configuration for the monitoring module. * `icingaweb2::module::puppetdb::certificate`: Installs a certificate for the Icinga Web 2 puppetdb module. ## Classes ### icingaweb2 Installs and configures Icinga Web 2. #### Examples ##### Use MySQL as backend for user authentication: ```puppet include ::mysql::server mysql::db { 'icingaweb2': user => 'icingaweb2', password => 'supersecret', host => 'localhost', grant => [ 'ALL' ], } class {'icingaweb2': manage_repo => 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: ```puppet include ::postgresql::server postgresql::server::db { 'icingaweb2': user => 'icingaweb2', password => postgresql_password('icingaweb2', 'icingaweb2'), } class {'icingaweb2': manage_repo => 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 The following parameters are available in the `icingaweb2` class. ##### `logging` Data type: `Enum['file', 'syslog', 'php', 'none']` Whether Icinga Web 2 should log to 'file', 'syslog' or 'php' (web server's error log). Setting 'none' disables logging. Default value: 'file' ##### `logging_file` Data type: `Stdlib::Absolutepath` If 'logging' is set to 'file', this is the target log file. ##### `logging_level` Data type: `Enum['ERROR', 'WARNING', 'INFO', 'DEBUG']` Logging verbosity. Possible values are 'ERROR', 'WARNING', 'INFO' and 'DEBUG'. Default value: 'INFO' ##### `logging_facility` Data type: `Pattern[/user|local[0-7]/]` Logging facility when using syslog. Possible values are 'user' or 'local0' up to 'local7'. Default value: 'user' ##### `logging_application` Data type: `String` Logging application name when using syslog. Default value: 'icingaweb2' ##### `show_stacktraces` Data type: `Boolean` Whether to display stacktraces in the web interface or not. Default value: `false` ##### `module_path` Data type: `Stdlib::Absolutepath` Path to module sources. Multiple paths must be separated by colon. ##### `theme` Data type: `String` The default theme setting. Users may override this settings. Default value: 'Icinga' ##### `theme_disabled` Data type: `Boolean` Whether users can change themes or not. Default value: `false` ##### `manage_repo` Data type: `Boolean` When set to true this module will install the packages.icinga.com repository. Default value: `false` ##### `manage_package` Data type: `Boolean` If set to `false` packages aren't managed. Default value: `true` ##### `extra_packages` Data type: `Optional[Array[String]]` An array of packages to install additionally. Default value: `undef` ##### `import_schema` Data type: `Boolean` Import database scheme. Make sure you have an existing database if you use this option. Default value: `false` ##### `db_type` Data type: `Enum['mysql', 'pgsql']` Database type, can be either `mysql` or `pgsql`. This parameter is only used if `import_schema` is `true` or `config_backend` is `db`. Default value: 'mysql' ##### `db_host` Data type: `Stdlib::Host` Database hostname. This parameter is only used if `import_schema` is `true` or `config_backend` is `db`. Default value: 'localhost' ##### `db_port` Data type: `Stdlib::Port` Port of database host. This parameter is only used if `import_schema` is `true` or `config_backend` is `db`. Default value: 3306 ##### `db_name` Data type: `String` Database name. This parameter is only used if `import_schema` is `true` or `config_backend` is `db`. Default value: 'icingaweb2' ##### `db_username` Data type: `Optional[String]` Username for database access. This parameter is only used if `import_schema` is `true` or `config_backend` is `db`. Default value: `undef` ##### `db_password` Data type: `Optional[String]` Password for database access. This parameter is only used if `import_schema` is `true` or `config_backend` is `db`. Default value: `undef` ##### `config_backend` Data type: `Enum['ini', 'db']` 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`. Default value: 'ini' ##### `conf_user` Data type: `String` By default this module expects Apache2 on the server. You can change the owner of the config files with this parameter. ##### `conf_group` Data type: `String` Group membership of config files. ##### `default_domain` Data type: `Optional[String]` When using domain-aware authentication, you can set a default domain here. Default value: `undef` ##### `cookie_path` Data type: `Optional[Stdlib::Absolutepath]` Path to where cookies are stored. Default value: `undef` ### icingaweb2::globals This class loads the default parameters by doing a hiera lookup. * **Note** This parameters depend on the os plattform. Changes maybe will break the functional capability of the supported plattforms and versions. Please only do changes when you know what you're doing. #### Parameters The following parameters are available in the `icingaweb2::globals` class. ##### `package_name` Data type: `String` ##### `conf_dir` Data type: `Stdlib::Absolutepath` ##### `mysql_db_schema` Data type: `Stdlib::Absolutepath` ##### `pgsql_db_schema` Data type: `Stdlib::Absolutepath` ##### `gettext_package_name` Data type: `String` ### icingaweb2::module::businessprocess Installs and enables the businessprocess module. -* **Note** Check out the [Business Process mdoule documentation](https://www.icinga.com/docs/businessprocess/latest/) for requirements. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. #### Examples ##### ```puppet class { 'icingaweb2::module::businessprocess': git_revision => 'v2.1.0' } ``` #### Parameters The following parameters are available in the `icingaweb2::module::businessprocess` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `master` or `v2.1.0`. Default value: `undef` ### icingaweb2::module::cube Installs and enables the cube module. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. + #### Examples ##### ```puppet class { 'icingaweb2::module::cube': git_revision => 'v1.0.0' } ``` #### Parameters The following parameters are available in the `icingaweb2::module::cube` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `master` or `v1.0.0`. Default value: `undef` ### icingaweb2::module::director Installs and configures the director module. -* **Note** Please checkout the [Director module documentation](https://www.icinga.com/docs/director/latest/) for requirements. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. #### Examples ##### ```puppet class { 'icingaweb2::module::director': git_revision => 'v1.7.2', db_host => 'localhost', db_name => 'director', db_username => 'director', db_password => 'supersecret', import_schema => true, kickstart => true, endpoint => 'puppet-icingaweb2.localdomain', api_username => 'director', api_password => 'supersecret', require => Mysql::Db['director'] } ``` #### Parameters The following parameters are available in the `icingaweb2::module::director` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `master` or `v1.3.2`. Default value: `undef` ##### `db_type` Data type: `Enum['mysql', 'pgsql']` Type of your database. Either `mysql` or `pgsql`. Default value: 'mysql' ##### `db_host` Data type: `Stdlib::Host` Hostname of the database. Default value: `undef` ##### `db_port` Data type: `Stdlib::Port` Port of the database. Default value: 3306 ##### `db_name` Data type: `Optional[String]` Name of the database. Default value: `undef` ##### `db_username` Data type: `Optional[String]` Username for DB connection. Default value: `undef` ##### `db_password` Data type: `Optional[String]` Password for DB connection. Default value: `undef` ##### `import_schema` Data type: `Boolean` Import database schema. Default value: `false` ##### `kickstart` Data type: `Boolean` Run kickstart command after database migration. This requires `import_schema` to be `true`. Default value: `false` ##### `endpoint` Data type: `Optional[String]` Endpoint object name of Icinga 2 API. This setting is only valid if `kickstart` is `true`. Default value: `undef` ##### `api_host` Data type: `Stdlib::Host` Icinga 2 API hostname. This setting is only valid if `kickstart` is `true`. Default value: 'localhost' ##### `api_port` Data type: `Stdlib::Port` Icinga 2 API port. This setting is only valid if `kickstart` is `true`. Default value: 5665 ##### `api_username` Data type: `Optional[String]` Icinga 2 API username. This setting is only valid if `kickstart` is `true`. Default value: `undef` ##### `api_password` Data type: `Optional[String]` Icinga 2 API password. This setting is only valid if `kickstart` is `true`. Default value: `undef` ##### `db_charset` Data type: `String` Default value: 'utf8' ### icingaweb2::module::doc The doc module provides an interface to the Icinga 2 and Icinga Web 2 documentation. #### Parameters The following parameters are available in the `icingaweb2::module::doc` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Defaults to `present` Default value: 'present' ### icingaweb2::module::elasticsearch The Elasticsearch module displays events from data stored in Elasticsearch. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. + #### Examples ##### ```puppet class { 'icingaweb2::module::elasticsearch': git_revision => 'v0.9.0', instances => { 'elastic' => { uri => 'http://localhost:9200', user => 'foo', password => 'bar', } }, eventtypes => { 'filebeat' => { instance => 'elastic', index => 'filebeat-*', filter => 'beat.hostname={host.name}', fields => 'input_type, source, message', } } } ``` #### Parameters The following parameters are available in the `icingaweb2::module::elasticsearch` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `master` or `v1.3.2`. Default value: `undef` ##### `instances` Data type: `Optional[Hash]` A hash that configures one or more Elasticsearch instances that this module connects to. The defined type `icingaweb2::module::elasticsearch::instance` is used to create the instance configuration. Default value: `undef` ##### `eventtypes` Data type: `Optional[Hash]` A hash oft ypes of events that should be displayed. Event types are always connected to instances. The defined type `icingaweb2::module::elasticsearch::eventtype` is used to create the event types. Default value: `undef` ### icingaweb2::module::fileshipper @example: class { 'icingaweb2::module::fileshipper': git_revision => 'v1.0.1', base_directories => { temp => '/var/lib/fileshipper' }, directories => { 'test' => { 'source' => '/var/lib/fileshipper/source', 'target' => '/var/lib/fileshipper/target', } } } -* **Note** To understand this modulei, please read [Fileshipper module documentation](https://www.icinga.com/docs/director/latest/fileshipper/doc/02-Installation/). +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. #### Parameters The following parameters are available in the `icingaweb2::module::fileshipper` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enables or disables module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `master` or `v1.3.2`. Default value: `undef` ##### `base_directories` Data type: `Hash` Hash of base directories. These directories can later be selected in the import source (Director). Default value: {} ##### `directories` Data type: `Hash` Deploy plain Icinga 2 configuration files through the Director to your Icinga 2 master. Default value: {} ### icingaweb2::module::generictts Installs and enables the generictts module. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. + #### Examples ##### ```puppet class { 'icingaweb2::module::generictts': git_revision => 'v2.0.0', ticketsystems => { 'my-ticket-system' => { pattern => '/#([0-9]{4,6})/', url => 'https://my.ticket.system/tickets/id=$1', }, }, } ``` #### Parameters The following parameters are available in the `icingaweb2::module::generictts` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `master` or `v2.0.0`. Default value: `undef` ##### `ticketsystems` Data type: `Hash` A hash of ticketsystems. The hash expects a `patten` and a `url` for each ticketsystem. The regex pattern is to match the ticket ID, eg. `/#([0-9]{4,6})/`. Place the ticket ID in the URL, eg. `https://my.ticket.system/tickets/id=$1`. Default value: {} ### icingaweb2::module::graphite The Graphite module draws graphs out of time series data stored in Graphite. -* **Note** Here the official [Graphite module documentation](https://www.icinga.com/docs/graphite/latest/) can be found. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. #### Examples ##### ```puppet class { 'icingaweb2::module::graphite': git_revision => 'v0.9.0', url => 'https://localhost:8080' } ``` #### Parameters The following parameters are available in the `icingaweb2::module::graphite` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enables or disables module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `master` or `v1.3.2`. Default value: `undef` ##### `url` Data type: `Optional[String]` URL to your Graphite Web/API. Default value: `undef` ##### `user` Data type: `Optional[String]` A user with access to your Graphite Web via HTTP basic authentication. Default value: `undef` ##### `password` Data type: `Optional[String]` The users password. Default value: `undef` ##### `graphite_writer_host_name_template` Data type: `Optional[String]` The value of your Icinga 2 GraphiteWriter's attribute `host_name_template` (if specified). Default value: `undef` ##### `graphite_writer_service_name_template` Data type: `Optional[String]` The value of your icinga 2 GraphiteWriter's attribute `service_name_template` (if specified). Default value: `undef` ### icingaweb2::module::incubator Installs and enables the incubator module. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. + #### Parameters The following parameters are available in the `icingaweb2::module::incubator` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Defaults to `present` Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. Defaults to github. ##### `git_revision` Data type: `String` Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`. ### icingaweb2::module::ipl Installs and enables the ipl module. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. + #### Parameters The following parameters are available in the `icingaweb2::module::ipl` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `String` Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`. ### icingaweb2::module::monitoring Requirements: * IDO feature in Icinga 2 (MySQL or PostgreSQL) * `ApiUser` object in Icinga 2 with proper permissions class {'icingaweb2::module::monitoring': ido_host => 'localhost', ido_db_type => 'mysql', ido_db_name => 'icinga2', ido_db_username => 'icinga2', ido_db_password => 'supersecret', commandtransports => { icinga2 => { transport => 'api', username => 'icingaweb2', password => 'supersecret', } } } * **Note** At first have a look at the [Monitoring module documentation](https://www.icinga.com/docs/icingaweb2/latest/modules/monitoring/doc/01-About/). #### Examples ##### This module is mandatory for almost every setup. It connects your Icinga Web interface to the Icinga 2 core. Current and history information are queried through the IDO database. Actions such as `Check Now`, `Set Downtime` or `Acknowledge` are send to the Icinga 2 API. ```puppet ``` #### Parameters The following parameters are available in the `icingaweb2::module::monitoring` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `protected_customvars` Data type: `Variant[String, Array[String]]` Custom variables in Icinga 2 may contain sensible information. Set patterns for custom variables that should be hidden in the web interface. Default value: ['*pw*', '*pass*', 'community'] ##### `ido_type` Data type: `Enum['mysql', 'pgsql']` Type of your IDO database. Either `mysql` or `pgsql`. Default value: 'mysql' ##### `ido_host` Data type: `Optional[Stdlib::Host]` Hostname of the IDO database. Default value: `undef` ##### `ido_port` Data type: `Stdlib::Port` Port of the IDO database. Default value: 3306 ##### `ido_db_name` Data type: `Optional[String]` Name of the IDO database. Default value: `undef` ##### `ido_db_username` Data type: `Optional[String]` Username for IDO DB connection. Default value: `undef` ##### `ido_db_password` Data type: `Optional[String]` Password for IDO DB connection. Default value: `undef` ##### `ido_db_charset` Data type: `Optional[String]` The character set to use for the database connection. Default value: `undef` ##### `commandtransports` Data type: `Hash` A hash of command transports. -Default value: `undef` +Default value: {} ### icingaweb2::module::puppetdb Installs and configures the puppetdb module. -* **Note** The [PuppetDB module documentation](https://www.icinga.com/docs/director/latest/puppetdb/doc/01-Installation/). +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. #### Examples ##### Set up the PuppetDB module and configure two custom SSL keys: ```puppet $certificates = { 'pupdb1' => { :ssl_key => '-----BEGIN RSA PRIVATE KEY----- abc...', :ssl_cacert => '-----BEGIN RSA PRIVATE KEY----- def...', }, 'pupdb2' => { :ssl_key => '-----BEGIN RSA PRIVATE KEY----- zyx...', :ssl_cacert => '-----BEGIN RSA PRIVATE KEY----- wvur...', }, } class { '::icingaweb2::module::puppetdb': git_revision => 'master', ssl => 'none', certificates => $certificates, } ``` ##### Set up the PuppetDB module and configure the hosts SSL key to connect to the PuppetDB host: ```puppet class {'::icingaweb2::module::puppetdb': git_revision => 'master', ssl => 'puppet', host => 'puppetdb.example.com', } ``` #### Parameters The following parameters are available in the `icingaweb2::module::puppetdb` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `master` or `v1.3.2`. Default value: `undef` ##### `ssl` Data type: `Enum['none', 'puppet']` How to set up ssl certificates. To copy certificates from the local puppet installation, use `puppet`. Default value: 'none' ##### `host` Data type: `Optional[Stdlib::Host]` Hostname of the server where PuppetDB is running. The `ssl` parameter needs to be set to `puppet`. Default value: `undef` ##### `certificates` Data type: `Hash` Hash with icingaweb2::module::puppetdb::certificate resources. Default value: {} ### icingaweb2::module::reactbundle Installs and enables the reactbundle module. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. + #### Parameters The following parameters are available in the `icingaweb2::module::reactbundle` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `String` Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`. ### icingaweb2::module::translation Installs and configures the translation module. #### Parameters The following parameters are available in the `icingaweb2::module::translation` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ### icingaweb2::module::vsphere The vSphere module extends the Director. It provides import sources for virtual machines and physical hosts from vSphere. -* **Note** Check out the [vSphere module documentation](https://www.icinga.com/docs/director/latest/vsphere/doc/). +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. #### Parameters The following parameters are available in the `icingaweb2::module::vsphere` class. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `git_repository` Data type: `String` Set a git repository URL. ##### `git_revision` Data type: `Optional[String]` Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`. Default value: `undef` ## Defined types ### icingaweb2::config::authmethod Manage Icinga Web 2 authentication methods. Auth methods may be chained by setting proper ordering. #### Examples ##### Create an authentication method (db) and reference to a resource: ```puppet icingaweb2::config::authmethod { 'db-auth': backend => 'db', resource => 'my-sql', order => 20, } ``` ##### Create a LDAP authmethod: ```puppet icingaweb2::config::authmethod { 'ldap-auth': backend => 'ldap', resource => 'my-ldap', ldap_user_class => 'user', ldap_filter => '(memberof:1.2.840.113556.1.4.1941:=CN=monitoring,OU=groups,DC=icinga,DC=com)', ldap_user_name_attribute => 'userPrincipalName', order => '05', } ``` #### Parameters The following parameters are available in the `icingaweb2::config::authmethod` defined type. ##### `backend` Data type: `Enum['external', 'ldap', 'msldap', 'db']` Select between 'external', 'ldap', 'msldap' or 'db'. Each backend may require other settings. Default value: `undef` ##### `resource` Data type: `Optional[String]` The name of the resource defined in resources.ini. Default value: `undef` ##### `ldap_user_class` Data type: `Optional[String]` LDAP user class. Only valid if `backend` is `ldap`. Default value: `undef` ##### `ldap_user_name_attribute` Data type: `Optional[String]` LDAP attribute which contains the username. Only valid if `backend` is `ldap`. Default value: `undef` ##### `ldap_filter` Data type: `Optional[String]` LDAP search filter. Only valid if `backend` is `ldap`. Default value: `undef` ##### `ldap_base_dn` Data type: `Optional[String]` LDAP base DN. Only valid if `backend` is `ldap`. Default value: `undef` ##### `domain` Data type: `Optional[String]` Domain for domain-aware authentication Default value: `undef` ##### `order` Data type: `Variant[String, Integer]` Multiple authentication methods can be chained. The order of entries in the authentication configuration determines the order of the authentication methods. Default value: '01' ### icingaweb2::config::groupbackend Groups of users can be stored either in a database, LDAP or ActiveDirectory. This defined type configures backends that store groups. #### Examples ##### A group backend for groups stored in LDAP: ```puppet icingaweb2::config::groupbackend { 'ldap-groups': backend => 'ldap', resource => 'my-ldap', ldap_group_class => 'group', ldap_group_name_attribute => 'cn', ldap_group_member_attribute => 'member', ldap_base_dn => 'ou=groups,dc=icinga,dc=com', domain => 'icinga.com', } ``` ##### If you have imported the database schema (parameter `import_schema`), this backend was also created automatically: ```puppet icingaweb2::config::groupbackend { 'mysql-backend': backend => 'db', resource => 'my-sql', } ``` #### Parameters The following parameters are available in the `icingaweb2::config::groupbackend` defined type. ##### `group_name` Data type: `String` Name of the resources. Resources are referenced by their name in other configuration sections. Default value: $title ##### `backend` Data type: `Enum['db', 'ldap', 'msldap']` Type of backend. Valide values are: `db`, `ldap` and `msldap`. Each backend supports different settings, see the parameters for detailed information. Default value: `undef` ##### `resource` Data type: `String` The resource used to connect to the backend. The resource contains connection information. Default value: `undef` ##### `ldap_user_backend` Data type: `Optional[String]` A group backend can be connected with an authentication method. This parameter references the auth method. Only valid with backend `ldap` or `msldap`. Default value: `undef` ##### `ldap_group_class` Data type: `Optional[String]` Class used to identify group objects. Only valid with backend `ldap`. Default value: `undef` ##### `ldap_group_filter` Data type: `Optional[String]` Use a LDAP filter to receive only certain groups. Only valid with backend `ldap` or `msldap`. Default value: `undef` ##### `ldap_group_name_attribute` Data type: `Optional[String]` The group name attribute. Only valid with backend `ldap`. Default value: `undef` ##### `ldap_group_member_attribute` Data type: `Optional[String]` The group member attribute. Only valid with backend `ldap`. Default value: `undef` ##### `ldap_base_dn` Data type: `Optional[String]` Base DN that is searched for groups. Only valid with backend `ldap` with `msldap`. Default value: `undef` ##### `ldap_nested_group_search` Data type: `Optional[Boolean]` Search for groups in groups. Only valid with backend `msldap`. Default value: `undef` ##### `domain` Data type: `Optional[String]` Domain for domain-aware authentication. Default value: `undef` ##### `order` Data type: `Variant[String, Integer]` Multiple authentication methods can be chained. The order of entries in the authentication configuration determines the order of the authentication methods. Default value: '01' ### icingaweb2::config::resource Create and remove Icinga Web 2 resources. Resources may be referenced in other configuration sections. #### Examples ##### Create a MySQL DB resource: ```puppet icingaweb2::config::resource{ 'my-sql': type => 'db', db_type => 'mysql', host => 'localhost', port => '3306', db_name => 'icingaweb2', db_username => 'icingaweb2', db_password => 'supersecret', } ``` ##### Create a LDAP resource: ```puppet icingaweb2::config::resource{ 'my-ldap': type => 'ldap', host => 'localhost', port => 389, ldap_root_dn => 'ou=users,dc=icinga,dc=com', ldap_bind_dn => 'cn=icingaweb2,ou=users,dc=icinga,dc=com', ldap_bind_pw => 'supersecret', } ``` #### Parameters The following parameters are available in the `icingaweb2::config::resource` defined type. ##### `resource_name` Data type: `String` Name of the resources. Resources are referenced by their name in other configuration sections. Default value: $title ##### `type` Data type: `Enum['db', 'ldap']` Supported resource types are `db` and `ldap`. ##### `host` Data type: `Optional[Stdlib::Host]` Connect to the database or ldap server on the given host. For using unix domain sockets, specify 'localhost' for MySQL and the path to the unix domain socket directory for PostgreSQL. When using the 'ldap' type you can also provide multiple hosts separated by a space. Default value: `undef` ##### `port` Data type: `Optional[Stdlib::Port]` Port number to use. Default value: `undef` ##### `db_type` Data type: `Optional[Enum['mysql', 'pgsql']]` Supported DB types are `mysql` and `pgsql`. Default value: `undef` ##### `db_name` Data type: `Optional[String]` The database to use. Only valid if `type` is `db`. Default value: `undef` ##### `db_username` Data type: `Optional[String]` The username to use when connecting to the server. Only valid if `type` is `db`. Default value: `undef` ##### `db_password` Data type: `Optional[String]` The password to use when connecting to the server. Only valid if `type` is `db`. Default value: `undef` ##### `db_charset` Data type: `Optional[String]` The character set to use for the database connection. Only valid if `type` is `db`. Default value: `undef` ##### `ldap_root_dn` Data type: `Optional[String]` Root object of the tree, e.g. 'ou=people,dc=icinga,dc=com'. Only valid if `type` is `ldap`. Default value: `undef` ##### `ldap_bind_dn` Data type: `Optional[String]` The user to use when connecting to the server. Only valid if `type` is `ldap`. Default value: `undef` ##### `ldap_bind_pw` Data type: `Optional[String]` The password to use when connecting to the server. Only valid if `type` is `ldap`. Default value: `undef` ##### `ldap_encryption` Data type: `Optional[Enum['none', 'starttls', 'ldaps']]` Type of encryption to use: none (default), starttls, ldaps. Only valid if `type` is `ldap`. Default value: 'none' ##### `ldap_timeout` Data type: `Integer` Timeout for the ldap connection. Default value: 5 ### icingaweb2::config::role Roles define a set of permissions that may be applied to users or groups. * **Note** Availble permissions in module monitoring: | Description | Value | |-------------|-------| | Allow everything | `*` | | Allow to share navigation items | `application/share/navigation` | | Allow to adjust in the preferences whether to show stacktraces | `application/stacktraces` | | Allow to view the application log | `application/log` | | Grant admin permissions, e.g. manage announcements | `admin` | | Allow config access | `config/*` | | Allow access to module doc | `module/doc` | | Allow access to module monitoring | `module/monitoring` | | Allow all commands | `monitoring/command/*` | | Allow scheduling host and service checks | `monitoring/command/schedule-check` | | Allow acknowledging host and service problems | `monitoring/command/acknowledge-problem` | | Allow removing problem acknowledgements | `monitoring/command/remove-acknowledgement` | | Allow adding and deleting host and service comments | `monitoring/command/comment/*` | | Allow commenting on hosts and services | `monitoring/command/comment/add` | | Allow deleting host and service comments | `monitoring/command/comment/delete` | | Allow scheduling and deleting host and service downtimes | `monitoring/command/downtime/*` | | Allow scheduling host and service downtimes | `monitoring/command/downtime/schedule` | | Allow deleting host and service downtimes | `monitoring/command/downtime/delete` | | Allow processing host and service check results | `monitoring/command/process-check-result` | | Allow processing commands for toggling features on an instance-wide basis | `monitoring/command/feature/instance` | | Allow processing commands for toggling features on host and service objects | `monitoring/command/feature/object/*`) | | Allow processing commands for toggling active checks on host and service objects | `monitoring/command/feature/object/active-checks` | | Allow processing commands for toggling passive checks on host and service objects | `monitoring/command/feature/object/passive-checks` | | Allow processing commands for toggling notifications on host and service objects | `monitoring/command/feature/object/notifications` | | Allow processing commands for toggling event handlers on host and service objects | `monitoring/command/feature/object/event-handler` | | Allow processing commands for toggling flap detection on host and service objects | `monitoring/command/feature/object/flap-detection` | | Allow sending custom notifications for hosts and services | `monitoring/command/send-custom-notification` | | Allow access to module setup | `module/setup` | | Allow access to module test | `module/test` | | Allow access to module translation | `module/translation` | #### Examples ##### Create role that allows only hosts beginning with `linux-*`: ```puppet icingaweb2::config::role{ 'linux-user': groups => 'linuxer', permissions => '*', filters => { 'monitoring/filter/objects' => 'host_name=linux-*' } } ``` ##### Create role that allows a user to see only hosts beginning with `linux-*`: ```puppet icingaweb2::config::role{'linux-user': users => 'bob, pete', permissions => '*', filters => { 'monitoring/filter/objects' => 'host_name=linux-*', } } ``` #### Parameters The following parameters are available in the `icingaweb2::config::role` defined type. ##### `role_name` Data type: `String` Name of the role. Default value: $title ##### `users` Data type: `Optional[String]` Comma separated list of users this role applies to. Default value: `undef` ##### `groups` Data type: `Optional[String]` Comma separated list of groups this role applies to. Default value: `undef` ##### `permissions` Data type: `Optional[String]` Comma separated lsit of permissions. Each module may add it's own permissions. Examples are - Allow everything: '*' - Allow config access: 'config/*' - Allow access do module monitoring: 'module/monitoring' - Allow scheduling checks: 'monitoring/command/schedule-checks' - Grant admin permissions: 'admin' Default value: `undef` ##### `filters` Data type: `Hash` Hash of filters. Modules may add new filter keys, some sample keys are: - application/share/users - application/share/groups - monitoring/filter/objects - monitoring/blacklist/properties A string value is expected for each used key. For example: - monitoring/filter/objects = "host_name!=*win*" Default value: {} ### icingaweb2::inisection Manage settings in INI configuration files. #### Examples ##### Create the configuration file and set two settings for the section `global`: ```puppet include icingawebeb2 icingaweb2::inisection { '/path/to/config.ini': settings => { 'global' => { 'setting1' => 'value', 'setting2' => 'value', }, }, } ``` #### Parameters The following parameters are available in the `icingaweb2::inisection` defined type. ##### `target` Data type: `Stdlib::Absolutepath` Absolute path to the configuration file. ##### `section_name` Data type: `String` Name of the target section. Settings are set under [$section_name] Default value: $title ##### `settings` Data type: `Hash` A hash of settings and their settings. Single settings may be set to absent. Default value: {} ##### `order` Data type: `Variant[String, Integer]` Ordering of the INI section within a file. Defaults to `01` Default value: '01' ### icingaweb2::module Download, enable and configure Icinga Web 2 modules. +* **Note** If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. + #### Examples ##### ```puppet $conf_dir = $::icingaweb2::globals::conf_dir $module_conf_dir = "${conf_dir}/modules/mymodule" $settings = { 'section1' => { 'target' => "${module_conf_dir}/config1.ini", 'settings' => { 'setting1' => 'value1', 'setting2' => 'value2', } }, 'section2' => { 'target' => "${module_conf_dir}/config2.ini", 'settings' => { 'setting3' => 'value3', 'setting4' => 'value4', } } } ``` #### Parameters The following parameters are available in the `icingaweb2::module` defined type. ##### `ensure` Data type: `Enum['absent', 'present']` Enable or disable module. Default value: 'present' ##### `module` Data type: `String` Name of the module. Default value: $title ##### `module_dir` Data type: `Stdlib::Absolutepath` Target directory of the module. Default value: "${::icingaweb2::module_path}/${title}" ##### `install_method` Data type: `Enum['git', 'none', 'package']` Install methods are `git`, `package` and `none` is supported as installation method. Defaults to `git` Default value: 'git' ##### `git_revision` Data type: `String` Tag or branch of the git repository. This setting is only valid in combination with the installation method `git`. Default value: 'master' ##### `package_name` Data type: `Optional[String]` Package name of the module. This setting is only valid in combination with the installation method `package`. Default value: `undef` ##### `settings` Data type: `Hash` A hash with the module settings. Multiple configuration files with ini sections can be configured with this hash. The `module_name` should be used as target directory for the configuration files. Default value: {} ##### `git_repository` Data type: `Optional[String]` Default value: `undef` diff --git a/manifests/module.pp b/manifests/module.pp index 9401166..f6db6b4 100644 --- a/manifests/module.pp +++ b/manifests/module.pp @@ -1,108 +1,110 @@ # @summary # Download, enable and configure Icinga Web 2 modules. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] module # Name of the module. # # @param [Stdlib::Absolutepath] module_dir # Target directory of the module. # # @param [Enum['git', 'none', 'package']] install_method # Install methods are `git`, `package` and `none` is supported as installation method. Defaults to `git` # # @param [String] git_revision # Tag or branch of the git repository. This setting is only valid in combination with the installation method `git`. # # @param [Optional[String]] package_name # Package name of the module. This setting is only valid in combination with the installation method `package`. # # @param [Hash] settings # A hash with the module settings. Multiple configuration files with ini sections can be configured with this hash. # The `module_name` should be used as target directory for the configuration files. # # @example # $conf_dir = $::icingaweb2::globals::conf_dir # $module_conf_dir = "${conf_dir}/modules/mymodule" # # $settings = { # 'section1' => { # 'target' => "${module_conf_dir}/config1.ini", # 'settings' => { # 'setting1' => 'value1', # 'setting2' => 'value2', # } # }, # 'section2' => { # 'target' => "${module_conf_dir}/config2.ini", # 'settings' => { # 'setting3' => 'value3', # 'setting4' => 'value4', # } # } # } # define icingaweb2::module( Enum['absent', 'present'] $ensure = 'present', String $module = $title, Stdlib::Absolutepath $module_dir = "${::icingaweb2::module_path}/${title}", Enum['git', 'none', 'package'] $install_method = 'git', Optional[String] $git_repository = undef, String $git_revision = 'master', Optional[String] $package_name = undef, Hash $settings = {}, ){ $conf_dir = $::icingaweb2::globals::conf_dir $conf_user = $::icingaweb2::conf_user $conf_group = $::icingaweb2::conf_group File { owner => $conf_user, group => $conf_group } if $ensure == 'present' { $ensure_module_enabled = 'link' $ensure_module_config_dir = 'directory' $ensure_vcsrepo = 'present' create_resources('icingaweb2::inisection', $settings) } else { $ensure_module_enabled = 'absent' $ensure_module_config_dir = 'absent' $ensure_vcsrepo = 'absent' } file {"${conf_dir}/enabledModules/${module}": ensure => $ensure_module_enabled, target => $module_dir, } file {"${conf_dir}/modules/${module}": ensure => $ensure_module_config_dir, force => true, recurse => true, } case $install_method { 'git': { vcsrepo { $module_dir: ensure => $ensure_vcsrepo, provider => 'git', source => $git_repository, revision => $git_revision, } } 'none': { } 'package': { package { $package_name: ensure => $ensure, } } default: { fail('The installation method you provided is not supported.') } } } diff --git a/manifests/module/businessprocess.pp b/manifests/module/businessprocess.pp index b06312e..ca1b200 100644 --- a/manifests/module/businessprocess.pp +++ b/manifests/module/businessprocess.pp @@ -1,30 +1,32 @@ # @summary # Installs and enables the businessprocess module. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `master` or `v2.1.0`. # # @note Check out the [Business Process mdoule documentation](https://www.icinga.com/docs/businessprocess/latest/) for requirements. # # @example # class { 'icingaweb2::module::businessprocess': # git_revision => 'v2.1.0' # } # class icingaweb2::module::businessprocess( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, ){ icingaweb2::module {'businessprocess': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/cube.pp b/manifests/module/cube.pp index 2f4a617..510ca1d 100644 --- a/manifests/module/cube.pp +++ b/manifests/module/cube.pp @@ -1,28 +1,30 @@ # @summary # Installs and enables the cube module. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `master` or `v1.0.0`. # # @example # class { 'icingaweb2::module::cube': # git_revision => 'v1.0.0' # } # class icingaweb2::module::cube( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, ){ icingaweb2::module {'cube': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/director.pp b/manifests/module/director.pp index 70e3972..d053b51 100644 --- a/manifests/module/director.pp +++ b/manifests/module/director.pp @@ -1,160 +1,162 @@ # @summary # Installs and configures the director module. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `master` or `v1.3.2`. # # @param [Enum['mysql', 'pgsql']] db_type # Type of your database. Either `mysql` or `pgsql`. # # @param [Stdlib::Host] db_host # Hostname of the database. # # @param [Stdlib::Port] db_port # Port of the database. # # @param [Optional[String]] db_name # Name of the database. # # @param [Optional[String]] db_username # Username for DB connection. # # @param [Optional[String]] db_password # Password for DB connection. # # @param [Boolean] import_schema # Import database schema. # # @param [Boolean] kickstart # Run kickstart command after database migration. This requires `import_schema` to be `true`. # # @param [Optional[String]] endpoint # Endpoint object name of Icinga 2 API. This setting is only valid if `kickstart` is `true`. # # @param [Stdlib::Host] api_host # Icinga 2 API hostname. This setting is only valid if `kickstart` is `true`. # # @param [Stdlib::Port] api_port # Icinga 2 API port. This setting is only valid if `kickstart` is `true`. # # @param [Optional[String]] api_username # Icinga 2 API username. This setting is only valid if `kickstart` is `true`. # # @param [Optional[String]] api_password # Icinga 2 API password. This setting is only valid if `kickstart` is `true`. # # @note Please checkout the [Director module documentation](https://www.icinga.com/docs/director/latest/) for requirements. # # @example # class { 'icingaweb2::module::director': # git_revision => 'v1.7.2', # db_host => 'localhost', # db_name => 'director', # db_username => 'director', # db_password => 'supersecret', # import_schema => true, # kickstart => true, # endpoint => 'puppet-icingaweb2.localdomain', # api_username => 'director', # api_password => 'supersecret', # require => Mysql::Db['director'] # } # class icingaweb2::module::director( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, Enum['mysql', 'pgsql'] $db_type = 'mysql', Stdlib::Host $db_host = undef, Stdlib::Port $db_port = 3306, Optional[String] $db_name = undef, Optional[String] $db_username = undef, Optional[String] $db_password = undef, String $db_charset = 'utf8', Boolean $import_schema = false, Boolean $kickstart = false, Optional[String] $endpoint = undef, Stdlib::Host $api_host = 'localhost', Stdlib::Port $api_port = 5665, Optional[String] $api_username = undef, Optional[String] $api_password = undef, ) { $conf_dir = $::icingaweb2::globals::conf_dir $module_conf_dir = "${conf_dir}/modules/director" Exec { user => 'root', path => $::path, } icingaweb2::config::resource { 'icingaweb2-module-director': type => 'db', db_type => $db_type, host => $db_host, port => $db_port, db_name => $db_name, db_username => $db_username, db_password => $db_password, db_charset => $db_charset, } $db_settings = { 'module-director-db' => { 'section_name' => 'db', 'target' => "${module_conf_dir}/config.ini", 'settings' => { 'resource' => 'icingaweb2-module-director' } } } if $import_schema { ensure_packages(['icingacli'], { 'ensure' => 'present' }) exec { 'director-migration': command => 'icingacli director migration run', onlyif => 'icingacli director migration pending', require => [ Package['icingacli'], Icingaweb2::Module['director'] ] } if $kickstart { $kickstart_settings = { 'module-director-config' => { 'section_name' => 'config', 'target' => "${module_conf_dir}/kickstart.ini", 'settings' => { 'endpoint' => $endpoint, 'host' => $api_host, 'port' => $api_port, 'username' => $api_username, 'password' => $api_password, } } } exec { 'director-kickstart': command => 'icingacli director kickstart run', onlyif => 'icingacli director kickstart required', require => Exec['director-migration'] } } else { $kickstart_settings = {} } } else { $kickstart_settings = {} } icingaweb2::module {'director': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, settings => merge($db_settings, $kickstart_settings), } } diff --git a/manifests/module/elasticsearch.pp b/manifests/module/elasticsearch.pp index 0a33694..a1be6e2 100644 --- a/manifests/module/elasticsearch.pp +++ b/manifests/module/elasticsearch.pp @@ -1,78 +1,80 @@ # @summary # The Elasticsearch module displays events from data stored in Elasticsearch. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `master` or `v1.3.2`. # # @param [Optional[Hash]] instances # A hash that configures one or more Elasticsearch instances that this module connects to. The defined type # `icingaweb2::module::elasticsearch::instance` is used to create the instance configuration. # # @param [Optional[Hash]] eventtypes # A hash oft ypes of events that should be displayed. Event types are always connected to instances. The defined type # `icingaweb2::module::elasticsearch::eventtype` is used to create the event types. # # @example # class { 'icingaweb2::module::elasticsearch': # git_revision => 'v0.9.0', # instances => { # 'elastic' => { # uri => 'http://localhost:9200', # user => 'foo', # password => 'bar', # } # }, # eventtypes => { # 'filebeat' => { # instance => 'elastic', # index => 'filebeat-*', # filter => 'beat.hostname={host.name}', # fields => 'input_type, source, message', # } # } # } # class icingaweb2::module::elasticsearch( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, Optional[Hash] $instances = undef, Optional[Hash] $eventtypes = undef, ){ if $instances { $instances.each |$name, $setting| { icingaweb2::module::elasticsearch::instance{ $name: uri => $setting['uri'], user => $setting['user'], password => $setting['password'], ca => $setting['ca'], client_certificate => $setting['client_certificate'], client_private_key => $setting['client_private_key'], } } } if $eventtypes { $eventtypes.each |$name, $setting| { icingaweb2::module::elasticsearch::eventtype { $name: instance => $setting['instance'], index => $setting['index'], filter => $setting['filter'], fields => $setting['fields'], } } } icingaweb2::module { 'elasticsearch': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/fileshipper.pp b/manifests/module/fileshipper.pp index df0dd09..1c528ad 100644 --- a/manifests/module/fileshipper.pp +++ b/manifests/module/fileshipper.pp @@ -1,71 +1,73 @@ # @summary # The fileshipper module extends the Director. It offers import sources to deal with CSV, JSON, YAML and XML files. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enables or disables module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `master` or `v1.3.2`. # # @param [Hash] base_directories # Hash of base directories. These directories can later be selected in the import source (Director). # # @param [Hash] directories # Deploy plain Icinga 2 configuration files through the Director to your Icinga 2 master. # # @note To understand this modulei, please read [Fileshipper module documentation](https://www.icinga.com/docs/director/latest/fileshipper/doc/02-Installation/). # # @note You've to manage source and target directories yourself. # # @example: # class { 'icingaweb2::module::fileshipper': # git_revision => 'v1.0.1', # base_directories => { # temp => '/var/lib/fileshipper' # }, # directories => { # 'test' => { # 'source' => '/var/lib/fileshipper/source', # 'target' => '/var/lib/fileshipper/target', # } # } # } # class icingaweb2::module::fileshipper( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, Hash $base_directories = {}, Hash $directories = {}, ){ $conf_dir = $::icingaweb2::globals::conf_dir $module_conf_dir = "${conf_dir}/modules/fileshipper" if $base_directories { $base_directories.each |$identifier, $directory| { icingaweb2::module::fileshipper::basedir{$identifier: basedir => $directory, } } } if $directories { $directories.each |$identifier, $settings| { icingaweb2::module::fileshipper::directory{$identifier: source => $settings['source'], target => $settings['target'], extensions => $settings['extensions'], } } } icingaweb2::module { 'fileshipper': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/generictts.pp b/manifests/module/generictts.pp index b56332e..9db884c 100644 --- a/manifests/module/generictts.pp +++ b/manifests/module/generictts.pp @@ -1,42 +1,44 @@ # @summary # Installs and enables the generictts module. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `master` or `v2.0.0`. # # @param [Hash] ticketsystems # A hash of ticketsystems. The hash expects a `patten` and a `url` for each ticketsystem. # The regex pattern is to match the ticket ID, eg. `/#([0-9]{4,6})/`. Place the ticket ID # in the URL, eg. `https://my.ticket.system/tickets/id=$1`. # # @example # class { 'icingaweb2::module::generictts': # git_revision => 'v2.0.0', # ticketsystems => { # 'my-ticket-system' => { # pattern => '/#([0-9]{4,6})/', # url => 'https://my.ticket.system/tickets/id=$1', # }, # }, # } # class icingaweb2::module::generictts( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, Hash $ticketsystems = {}, ){ create_resources('icingaweb2::module::generictts::ticketsystem', $ticketsystems) icingaweb2::module {'generictts': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/graphite.pp b/manifests/module/graphite.pp index e642120..d87a804 100644 --- a/manifests/module/graphite.pp +++ b/manifests/module/graphite.pp @@ -1,80 +1,82 @@ # @summary # The Graphite module draws graphs out of time series data stored in Graphite. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enables or disables module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `master` or `v1.3.2`. # # @param [Optional[String]] url # URL to your Graphite Web/API. # # @param [Optional[String]] user # A user with access to your Graphite Web via HTTP basic authentication. # # @param [Optional[String]] password # The users password. # # @param [Optional[String]] graphite_writer_host_name_template # The value of your Icinga 2 GraphiteWriter's attribute `host_name_template` (if specified). # # @param [Optional[String]] graphite_writer_service_name_template # The value of your icinga 2 GraphiteWriter's attribute `service_name_template` (if specified). # # @note Here the official [Graphite module documentation](https://www.icinga.com/docs/graphite/latest/) can be found. # # @example # class { 'icingaweb2::module::graphite': # git_revision => 'v0.9.0', # url => 'https://localhost:8080' # } # class icingaweb2::module::graphite( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, Optional[String] $url = undef, Optional[String] $user = undef, Optional[String] $password = undef, Optional[String] $graphite_writer_host_name_template = undef, Optional[String] $graphite_writer_service_name_template = undef ){ $conf_dir = $::icingaweb2::globals::conf_dir $module_conf_dir = "${conf_dir}/modules/graphite" $graphite_settings = { 'url' => $url, 'user' => $user, 'password' => $password, } $icinga_settings = { 'graphite_writer_host_name_template' => $graphite_writer_host_name_template, 'graphite_writer_service_name_template' => $graphite_writer_service_name_template, } $settings = { 'module-graphite-graphite' => { 'section_name' => 'graphite', 'target' => "${module_conf_dir}/config.ini", 'settings' => delete_undef_values($graphite_settings) }, 'module-graphite-icinga' => { 'section_name' => 'icinga', 'target' => "${module_conf_dir}/config.ini", 'settings' => delete_undef_values($icinga_settings) } } icingaweb2::module { 'graphite': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, settings => $settings, } } diff --git a/manifests/module/incubator.pp b/manifests/module/incubator.pp index 850f5ef..7764100 100644 --- a/manifests/module/incubator.pp +++ b/manifests/module/incubator.pp @@ -1,25 +1,27 @@ # @summary # Installs and enables the incubator module. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. Defaults to `present` # # @param [String] git_repository # Set a git repository URL. Defaults to github. # # @param [String] git_revision # Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`. # class icingaweb2::module::incubator( String $git_repository, String $git_revision, Enum['absent', 'present'] $ensure = 'present', ){ icingaweb2::module { 'incubator': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/ipl.pp b/manifests/module/ipl.pp index 196ba39..8511d89 100644 --- a/manifests/module/ipl.pp +++ b/manifests/module/ipl.pp @@ -1,25 +1,27 @@ # @summary # Installs and enables the ipl module. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [String] git_revision # Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`. # class icingaweb2::module::ipl( String $git_repository, String $git_revision, Enum['absent', 'present'] $ensure = 'present', ){ icingaweb2::module { 'ipl': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/puppetdb.pp b/manifests/module/puppetdb.pp index 9942eff..bc506f2 100644 --- a/manifests/module/puppetdb.pp +++ b/manifests/module/puppetdb.pp @@ -1,132 +1,134 @@ # @summary # Installs and configures the puppetdb module. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `master` or `v1.3.2`. # # @param [Enum['none', 'puppet']] ssl # How to set up ssl certificates. To copy certificates from the local puppet installation, use `puppet`. # # @param [Optional[Stdlib::Host]] host # Hostname of the server where PuppetDB is running. The `ssl` parameter needs to be set to `puppet`. # # @param [Hash] certificates # Hash with icingaweb2::module::puppetdb::certificate resources. # # @note The [PuppetDB module documentation](https://www.icinga.com/docs/director/latest/puppetdb/doc/01-Installation/). # # @example Set up the PuppetDB module and configure two custom SSL keys: # $certificates = { # 'pupdb1' => { # :ssl_key => '-----BEGIN RSA PRIVATE KEY----- abc...', # :ssl_cacert => '-----BEGIN RSA PRIVATE KEY----- def...', # }, # 'pupdb2' => { # :ssl_key => '-----BEGIN RSA PRIVATE KEY----- zyx...', # :ssl_cacert => '-----BEGIN RSA PRIVATE KEY----- wvur...', # }, # } # # class { '::icingaweb2::module::puppetdb': # git_revision => 'master', # ssl => 'none', # certificates => $certificates, # } # # @example Set up the PuppetDB module and configure the hosts SSL key to connect to the PuppetDB host: # class {'::icingaweb2::module::puppetdb': # git_revision => 'master', # ssl => 'puppet', # host => 'puppetdb.example.com', # } # class icingaweb2::module::puppetdb( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, Enum['none', 'puppet'] $ssl = 'none', Optional[Stdlib::Host] $host = undef, Hash $certificates = {}, ){ $conf_dir = "${::icingaweb2::globals::conf_dir}/modules/puppetdb" $ssl_dir = "${conf_dir}/ssl" $conf_user = $::icingaweb2::conf_user $conf_group = $::icingaweb2::conf_group file { $ssl_dir: ensure => 'directory', group => $conf_group, owner => $conf_user, mode => '2740', purge => true, force => true, recurse => true, } case $ssl { 'puppet': { $puppetdb_ssldir = "${ssl_dir}/${host}" file { [$puppetdb_ssldir, "${puppetdb_ssldir}/private_keys", "${puppetdb_ssldir}/certs"]: ensure => 'directory', group => $conf_group, owner => $conf_user, mode => '2740', purge => true, force => true, recurse => true, } file { "${puppetdb_ssldir}/certs/ca.pem": ensure => 'present', group => $conf_group, owner => $conf_user, mode => '0640', source => "${::settings::ssldir}/certs/ca.pem", } $combinedkey_path = "${puppetdb_ssldir}/private_keys/${::fqdn}_combined.pem" notice("${::settings::ssldir}") concat { $combinedkey_path: ensure => present, warn => false, owner => $conf_user, group => $conf_group, mode => '0640', ensure_newline => true, } concat::fragment { 'private_key': target => $combinedkey_path, source => "${::settings::ssldir}/private_keys/${::fqdn}.pem", order => 1, } concat::fragment { 'public_key': target => $combinedkey_path, source => "${::settings::ssldir}/certs/${::fqdn}.pem", order => 2, } } # puppet 'none': { } default: { } } # case ssl create_resources('icingaweb2::module::puppetdb::certificate',$certificates) icingaweb2::module {'puppetdb': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/reactbundle.pp b/manifests/module/reactbundle.pp index feeddf7..b95e536 100644 --- a/manifests/module/reactbundle.pp +++ b/manifests/module/reactbundle.pp @@ -1,26 +1,28 @@ # @summary # Installs and enables the reactbundle module. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [String] git_revision # Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`. # class icingaweb2::module::reactbundle( String $git_repository, String $git_revision, Enum['absent', 'present'] $ensure = 'present', ){ icingaweb2::module { 'reactbundle': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } } diff --git a/manifests/module/vsphere.pp b/manifests/module/vsphere.pp index 43225f5..581b8a7 100644 --- a/manifests/module/vsphere.pp +++ b/manifests/module/vsphere.pp @@ -1,26 +1,28 @@ # @summary # The vSphere module extends the Director. It provides import sources for virtual machines and physical hosts from vSphere. # +# @note If you want to use `git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`. +# # @param [Enum['absent', 'present']] ensure # Enable or disable module. # # @param [String] git_repository # Set a git repository URL. # # @param [Optional[String]] git_revision # Set either a branch or a tag name, eg. `stable/0.7.0` or `v0.7.0`. # # @note Check out the [vSphere module documentation](https://www.icinga.com/docs/director/latest/vsphere/doc/). # class icingaweb2::module::vsphere( String $git_repository, Enum['absent', 'present'] $ensure = 'present', Optional[String] $git_revision = undef, ){ icingaweb2::module { 'vsphere': ensure => $ensure, git_repository => $git_repository, git_revision => $git_revision, } }