diff --git a/CHANGELOG.md b/CHANGELOG.md index cadec9b..aa427b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Change Log +## [v2.4.0](https://github.com/icinga/puppet-icinga/tree/v2.4.0) (2021-11-05) +[Full Changelog](https://github.com/icinga/puppet-icinga/compare/v2.3.3...v2.4.0) + +**Implemented enhancements:** + +- Remove listen from icinga::web [\#40](https://github.com/Icinga/puppet-icinga/issues/40) +- Extend icinga::database with a parameter to set database encoding [\#39](https://github.com/Icinga/puppet-icinga/issues/39) +- Add director support [\#38](https://github.com/Icinga/puppet-icinga/issues/38) + +## [v2.3.3](https://github.com/icinga/puppet-icinga/tree/v2.3.3) (2021-09-03) +[Full Changelog](https://github.com/icinga/puppet-icinga/compare/v2.3.2...v2.3.3) + +**Fixed bugs:** + +- Namespace function postgresql::postgresql\_password does not work on Puppet 5 [\#36](https://github.com/Icinga/puppet-icinga/issues/36) + ## [v2.3.2](https://github.com/icinga/puppet-icinga/tree/v2.3.2) (2021-08-17) [Full Changelog](https://github.com/icinga/puppet-icinga/compare/v2.3.1...v2.3.2) @@ -121,4 +137,4 @@ ## [v0.1.0](https://github.com/icinga/puppet-icinga/tree/v0.1.0) (2020-04-20) -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* \ No newline at end of file +\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* diff --git a/REFERENCE.md b/REFERENCE.md index f343372..7860be2 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -16,6 +16,8 @@ * [`icinga::server`](#icingaserver): Setup a Icinga server. * [`icinga::web`](#icingaweb): Setup Icinga Web 2 including a database backend for user settings. * [`icinga::web::database`](#icingawebdatabase): Setup Icinga Web 2 database for user settings. +* [`icinga::web::director`](#icingawebdirector): Setup Director module for Icinga Web 2 +* [`icinga::web::director::database`](#icingawebdirectordatabase): Setup Director database. * [`icinga::worker`](#icingaworker): Setup a Icinga worker (aka satellite). #### Private Classes @@ -160,7 +162,7 @@ Default value: `'icinga2'` Data type: `Boolean` -Create database. +Create database and import schema. Default value: ``false`` @@ -379,6 +381,22 @@ Icinga API user password. Default value: ``undef`` +##### `director_api_user` + +Data type: `String` + +Icinga API director user to connect Icinga 2. + +Default value: `'director'` + +##### `director_api_pass` + +Data type: `Optional[String]` + +Icinga API director user password. + +Default value: ``undef`` + ##### `logging_type` Data type: `Enum['file', 'syslog']` @@ -567,6 +585,154 @@ Database user name. Default value: `'icingaweb2'` +### `icinga::web::director` + +Setup Director module for Icinga Web 2 + +#### Parameters + +The following parameters are available in the `icinga::web::director` class. + +##### `service_ensure` + +Data type: `Stdlib::Ensure::Service` + +Manages if the Director service should be stopped or running. + +Default value: `'running'` + +##### `service_enable` + +Data type: `Boolean` + +If set to true the Director service will start on boot. + +Default value: ``true`` + +##### `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: `'localhost'` + +##### `db_port` + +Data type: `Optional[Stdlib::Port]` + +Port of the database. + +Default value: ``undef`` + +##### `db_name` + +Data type: `String` + +Name of the database. + +Default value: `'director'` + +##### `db_user` + +Data type: `String` + +Username for DB connection. + +Default value: `'director'` + +##### `db_pass` + +Data type: `String` + +Password for DB connection. + +##### `endpoint` + +Data type: `String` + +Endpoint object name of Icinga 2 API. + +##### `manage_database` + +Data type: `Boolean` + +Create database and import schema. + +Default value: ``false`` + +##### `api_host` + +Data type: `Stdlib::Host` + +Icinga 2 API hostname. + +Default value: `'localhost'` + +##### `api_user` + +Data type: `String` + +Icinga 2 API username. + +Default value: `'director'` + +##### `api_pass` + +Data type: `String` + +Icinga 2 API password. + +### `icinga::web::director::database` + +Setup Director database. + +#### Parameters + +The following parameters are available in the `icinga::web::director::database` class. + +##### `db_type` + +Data type: `Enum['mysql','pgsql']` + +What kind of database type to use. + +##### `web_instances` + +Data type: `Array[Stdlib::Host]` + +List of Hosts to allow write access to the database. Usually an Icinga Web 2 instance. + +##### `db_pass` + +Data type: `String` + +Password to connect the database. + +##### `db_name` + +Data type: `String` + +Name of the database. + +Default value: `'director'` + +##### `db_user` + +Data type: `String` + +Database user name. + +Default value: `'director'` + ### `icinga::worker` Setup a Icinga worker (aka satellite). diff --git a/TESTING.md b/TESTING.md index bf3d920..9f1d1aa 100644 --- a/TESTING.md +++ b/TESTING.md @@ -5,16 +5,20 @@ Before starting any test, you should make sure you have installed the Puppet PDK also Vagrant and VirtualBox have to be installed for acceptance tests. Required gems are installed with `bundler`: -``` +``` bash cd puppet-icinga pdk bundle install ``` +Or if already installed do an update. +``` bash +pdk bundle update +``` ## Validation tests Validation tests will check all manifests, templates and ruby files against syntax violations and style guides . Run validation tests: -``` +``` bash cd puppet-icinga pdk bundle exec rake validate ``` @@ -23,7 +27,7 @@ pdk bundle exec rake validate With puppet-lint we test if our manifests conform to the recommended style guides from Puppet. Run lint tests: -``` +``` bash cd puppet-icinga pdk bundle exec rake lint ``` @@ -32,13 +36,13 @@ pdk bundle exec rake lint For unit testing we use [RSpec]. All classes, defined resource types and functions should have appropriate unit tests. Run unit tests: -``` +``` bash cd puppet-icinga pdk test unit -``` +``` bash Or dedicated tests: -``` +``` bash pdk test unit --tests=spec/classes/repos_spec.rb,spec/classes/redis_spec.rb ``` @@ -50,24 +54,24 @@ We define these tests with [Litmus] and run them on VMs by using [Vagrant]. All available acceptance tests are listed in the `spec/acceptance` directory. Provision the virtual machines: -``` +``` bash cd puppet-icinga pdk bundle exec rake litmus:provision_list[vagrant] ``` Install the Agent and the Modul itself: -``` +``` bash pdk bundle exec rake litmus:install_agent pdk bundle exec bolt task run provision::fix_secure_path --modulepath spec/fixtures/modules -i inventory.yaml -t ssh_nodes pdk bundle exec rake litmus:install_module ``` Run the acceptance tests: -``` +``` bash pdk bundle exec rake litmus:acceptance:parallel ``` Cleanup and remove the virtual machines: -``` +``` bash pdk bundle exec rake litmus:tear_down ``` diff --git a/manifests/web/director.pp b/manifests/web/director.pp index 2102aee..0c3a628 100644 --- a/manifests/web/director.pp +++ b/manifests/web/director.pp @@ -10,22 +10,22 @@ # @param [Enum['mysql', 'pgsql']] db_type # Type of your database. Either `mysql` or `pgsql`. # -# @param [Optional[Stdlib::Host]] db_host +# @param [Stdlib::Host] db_host # Hostname of the database. # # @param [Optional[Stdlib::Port]] db_port # Port of the database. # -# @param [Optional[String]] db_name +# @param [String] db_name # Name of the database. # -# @param [Optional[String]] db_user +# @param [String] db_user # Username for DB connection. # -# @param [Optional[String]] db_pass +# @param [String] db_pass # Password for DB connection. # -# @param [Optional[String]] endpoint +# @param [String] endpoint # Endpoint object name of Icinga 2 API. # # @param [Boolean] manage_database @@ -34,10 +34,10 @@ # @param [Stdlib::Host] api_host # Icinga 2 API hostname. # -# @param [Optional[String]] api_user +# @param [String] api_user # Icinga 2 API username. # -# @param [Optional[String]] api_pass +# @param [String] api_pass # Icinga 2 API password. # class icinga::web::director( @@ -46,7 +46,7 @@ String $endpoint, Stdlib::Ensure::Service $service_ensure = 'running', Boolean $service_enable = true, - Enum['mysql','pgsql'] $db_type = 'mysql', + Enum['mysql', 'pgsql'] $db_type = 'mysql', Stdlib::Host $db_host = 'localhost', Optional[Stdlib::Port] $db_port = undef, String $db_name = 'director', diff --git a/metadata.json b/metadata.json index f8a17f0..3911b12 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "icinga-icinga", - "version": "2.3.3", + "version": "2.4.0", "author": "Icinga", "summary": "Puppet Module to manage Icinga repositories and provides a base class for Icinga Redis", "license": "Apache-2.0", @@ -59,7 +59,8 @@ "operatingsystemrelease": [ "8", "9", - "10" + "10", + "11" ] }, {