Skip to content

Commit

Permalink
fix #301 Move more defaults to data in module
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Nov 13, 2023
1 parent ad5c16e commit 992a538
Show file tree
Hide file tree
Showing 35 changed files with 224 additions and 297 deletions.
200 changes: 30 additions & 170 deletions REFERENCE.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions data/Linux-kernel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ icingaweb2::module::reporting::package_name: icingaweb2-module-reporting
icingaweb2::module::idoreports::package_name: icingaweb2-module-idoreports
icingaweb2::module::vspheredb::package_name: icingaweb2-module-vspheredb
icingaweb2::module::x509::package_name: icingaweb2-module-x509
icingaweb2::module::audit::package_name: icingaweb2-module-audit
icingaweb2::module::businessprocess::package_name: icingaweb2-module-businessprocess
icingaweb2::module::cube::package_name: icingaweb2-module-cube
icingaweb2::module::elasticsearch::package_name: icingaweb2-module-elasticsearch
icingaweb2::module::fileshipper::package_name: icingaweb2-module-fileshipper
icingaweb2::module::generictts::package_name: icingaweb2-module-generictts
icingaweb2::module::graphite::package_name: icingaweb2-module-graphite
icingaweb2::module::pdfexport::package_name: icingaweb2-module-pdfexport
icingaweb2::module::puppetdb::package_name: icingaweb2-module-puppetdb
82 changes: 72 additions & 10 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
---
icingaweb2::globals::role_replace: true
icingaweb2::conf_group: icingaweb2
icingaweb2::logging: syslog
icingaweb2::logging_level: INFO
icingaweb2::logging_facility: user
icingaweb2::logging_application: icingaweb2
icingaweb2::show_stacktraces: false
icingaweb2::theme: Icinga
icingaweb2::theme_disabled: false
icingaweb2::manage_repos: false
icingaweb2::manage_package: true
icingaweb2::import_schema: false
icingaweb2::db_host: localhost
icingaweb2::db_name: icingaweb2
icingaweb2::db_username: icingaweb2
icingaweb2::resources: {}
icingaweb2::user_backends: {}
icingaweb2::group_backends: {}
icingaweb2::admin_role:
name: default admin user
icingaweb2::default_admin_username: icingaadmin
icingaweb2::default_admin_password: icinga
icingaweb2::globals::role_replace: true
icingaweb2::module::businessprocess::git_repository: https://github.com/Icinga/icingaweb2-module-businessprocess.git
icingaweb2::module::cube::git_repository: https://github.com/Icinga/icingaweb2-module-cube.git
icingaweb2::module::elasticsearch::git_repository: https://github.com/Icinga/icingaweb2-module-elasticsearch.git
icingaweb2::module::fileshipper::git_repository: https://github.com/Icinga/icingaweb2-module-fileshipper.git
icingaweb2::module::generictts::git_repository: https://github.com/Icinga/icingaweb2-module-generictts.git
icingaweb2::module::graphite::git_repository: https://github.com/Icinga/icingaweb2-module-graphite.git
icingaweb2::module::incubator::git_repository: https://github.com/Icinga/icingaweb2-module-incubator.git
icingaweb2::module::incubator::git_revision: v0.19.0
icingaweb2::module::puppetdb::git_repository: https://github.com/Icinga/icingaweb2-module-puppetdb.git

icingaweb2::module::monitoring::ensure: present
icingaweb2::module::monitoring::protected_customvars:
Expand All @@ -23,8 +30,10 @@ icingaweb2::module::monitoring::protected_customvars:
icingaweb2::module::monitoring::ido_host: localhost
icingaweb2::module::monitoring::ido_db_name: icinga2
icingaweb2::module::monitoring::ido_db_username: icinga2
icingaweb2::module::monitoring::commandtransports: {}

icingaweb2::module::icingadb::ensure: present
icingaweb2::module::icingadb::commandtransports: {}
icingaweb2::module::icingadb::redis_host: localhost
icingaweb2::module::icingadb::db_host: localhost
icingaweb2::module::icingadb::db_name: icingadb
Expand All @@ -35,6 +44,8 @@ icingaweb2::module::director::install_method: git
icingaweb2::module::director::git_repository: https://github.com/Icinga/icingaweb2-module-director.git
icingaweb2::module::director::api_host: localhost
icingaweb2::module::director::api_port: 5665
icingaweb2::module::director::import_schema: false
icingaweb2::module::director::kickstart: false
icingaweb2::module::director::manage_service: true
icingaweb2::module::director::service_ensure: running
icingaweb2::module::director::service_enable: true
Expand All @@ -52,6 +63,7 @@ icingaweb2::module::reporting::manage_service: true
icingaweb2::module::reporting::service_ensure: running
icingaweb2::module::reporting::service_enable: true
icingaweb2::module::reporting::service_user: icingareporting
icingaweb2::module::reporting::import_schema: false
icingaweb2::module::reporting::db_host: localhost
icingaweb2::module::reporting::db_name: reporting
icingaweb2::module::reporting::db_username: reporting
Expand All @@ -63,6 +75,7 @@ icingaweb2::globals::pgsql_idoreports_sla_percent: /schema/postgresql/get_sla_ok
icingaweb2::module::idoreports::ensure: present
icingaweb2::module::idoreports::install_method: git
icingaweb2::module::idoreports::git_repository: https://github.com/Icinga/icingaweb2-module-idoreports.git
icingaweb2::module::idoreports::import_schema: false

icingaweb2::globals::mysql_x509_schema: /schema/mysql.schema.sql
icingaweb2::globals::pgsql_x509_schema: /schema/pgsql.schema.sql
Expand All @@ -74,6 +87,7 @@ icingaweb2::module::x509::manage_service: true
icingaweb2::module::x509::service_ensure: running
icingaweb2::module::x509::service_enable: true
icingaweb2::module::x509::service_user: icingax509
icingaweb2::module::x509::import_schema: false
icingaweb2::module::x509::db_host: localhost
icingaweb2::module::x509::db_name: x509
icingaweb2::module::x509::db_username: x509
Expand All @@ -87,6 +101,54 @@ icingaweb2::module::vspheredb::manage_service: true
icingaweb2::module::vspheredb::service_ensure: running
icingaweb2::module::vspheredb::service_enable: true
icingaweb2::module::vspheredb::service_user: icingavspheredb
icingaweb2::module::vspheredb::import_schema: false
icingaweb2::module::vspheredb::db_host: localhost
icingaweb2::module::vspheredb::db_name: vspheredb
icingaweb2::module::vspheredb::db_username: vspheredb

icingaweb2::module::audit::ensure: present
icingaweb2::module::audit::install_method: git
icingaweb2::module::audit::git_repository: https://github.com/Icinga/icingaweb2-module-audit.git
icingaweb2::module::audit::log_type: none
icingaweb2::module::audit::stream_format: none
icingaweb2::module::audit::log_facility: auth

icingaweb2::module::businessprocess::ensure: present
icingaweb2::module::businessprocess::install_method: git
icingaweb2::module::businessprocess::git_repository: https://github.com/Icinga/icingaweb2-module-businessprocess.git

icingaweb2::module::cube::ensure: present
icingaweb2::module::cube::git_repository: https://github.com/Icinga/icingaweb2-module-cube.git
icingaweb2::module::cube::install_method: git

icingaweb2::module::doc: present
icingaweb2::module::translation: present

icingaweb2::module::elasticsearch::ensure: present
icingaweb2::module::elasticsearch::git_repository: https://github.com/Icinga/icingaweb2-module-elasticsearch.git
icingaweb2::module::elasticsearch::install_method: git

icingaweb2::module::fileshipper::ensure: present
icingaweb2::module::fileshipper::git_repository: https://github.com/Icinga/icingaweb2-module-fileshipper.git
icingaweb2::module::fileshipper::install_method: git
icingaweb2::module::fileshipper::base_directories: {}
icingaweb2::module::fileshipper::directories: {}

icingaweb2::module::generictts::ensure: present
icingaweb2::module::generictts::git_repository: https://github.com/Icinga/icingaweb2-module-generictts.git
icingaweb2::module::generictts::install_method: git
icingaweb2::module::generictts::ticketsystems: {}

icingaweb2::module::graphite::ensure: present
icingaweb2::module::graphite::git_repository: https://github.com/Icinga/icingaweb2-module-graphite.git
icingaweb2::module::graphite::install_method: git

icingaweb2::module::pdfexport::ensure: present
icingaweb2::module::pdfexport::git_repository: https://github.com/Icinga/icingaweb2-module-pdfexport.git
icingaweb2::module::pdfexport::install_method: git

icingaweb2::module::puppetdb::ensure: present
icingaweb2::module::puppetdb::git_repository: https://github.com/Icinga/icingaweb2-module-puppetdb.git
icingaweb2::module::puppetdb::install_method: git
icingaweb2::module::puppetdb::ssl: none
icingaweb2::module::puppetdb::certificates: {}
40 changes: 20 additions & 20 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -213,24 +213,24 @@
Variant[Icingaweb2::AdminRole, Boolean[false]] $admin_role,
String $default_admin_username,
Icingaweb2::Secret $default_admin_password,
Optional[Variant[Stdlib::Absolutepath,
Array[Stdlib::Absolutepath]]] $module_path = undef,
Enum['file', 'syslog', 'php', 'none'] $logging = 'syslog',
Enum['ERROR', 'WARNING', 'INFO', 'DEBUG'] $logging_level = 'INFO',
Pattern[/user|local[0-7]/] $logging_facility = 'user',
String $logging_application = 'icingaweb2',
Boolean $show_stacktraces = false,
String $theme = 'Icinga',
Boolean $theme_disabled = false,
Boolean $manage_repos = false,
Boolean $manage_package = true,
Optional[Array[String]] $extra_packages = undef,
Variant[Boolean, Enum['mariadb', 'mysql']] $import_schema = false,
Stdlib::Host $db_host = 'localhost',
Optional[Stdlib::Port] $db_port = undef,
String $db_name = 'icingaweb2',
String $db_username = 'icingaweb2',
Enum['file', 'syslog', 'php', 'none'] $logging,
Enum['ERROR', 'WARNING', 'INFO', 'DEBUG'] $logging_level,
Pattern[/user|local[0-7]/] $logging_facility,
String $logging_application,
Boolean $show_stacktraces,
String $theme,
Boolean $theme_disabled,
Boolean $manage_repos,
Boolean $manage_package,
Hash[String, Hash[String, Any]] $resources,
Hash[String, Hash[String, Any]] $user_backends,
Hash[String, Hash[String, Any]] $group_backends,
Variant[Boolean, Enum['mariadb', 'mysql']] $import_schema,
Stdlib::Host $db_host,
String $db_name,
String $db_username,
Optional[Icingaweb2::Secret] $db_password = undef,
Optional[Stdlib::Port] $db_port = undef,
Optional[Boolean] $use_tls = undef,
Optional[Stdlib::Absolutepath] $tls_key_file = undef,
Optional[Stdlib::Absolutepath] $tls_cert_file = undef,
Expand All @@ -241,11 +241,11 @@
Optional[String] $tls_cacert = undef,
Optional[Boolean] $tls_noverify = undef,
Optional[String] $tls_cipher = undef,
Optional[Variant[Stdlib::Absolutepath,
Array[Stdlib::Absolutepath]]] $module_path = undef,
Optional[Array[String]] $extra_packages = undef,
Optional[String] $default_domain = undef,
Optional[Stdlib::Absolutepath] $cookie_path = undef,
Hash[String, Hash[String, Any]] $resources = {},
Hash[String, Hash[String, Any]] $user_backends = {},
Hash[String, Hash[String, Any]] $group_backends = {},
) {
require icingaweb2::globals

Expand Down
24 changes: 12 additions & 12 deletions manifests/module/audit.pp
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@
# }
#
class icingaweb2::module::audit (
Enum['absent', 'present'] $ensure = 'present',
Optional[Stdlib::Absolutepath] $module_dir = undef,
String $git_repository = 'https://github.com/Icinga/icingaweb2-module-audit.git',
Optional[String] $git_revision = undef,
Enum['git', 'none', 'package'] $install_method = 'git',
String $package_name = 'icingaweb2-module-audit',
Enum['file', 'syslog', 'none'] $log_type = 'none',
Optional[Stdlib::Absolutepath] $log_file = undef,
Optional[String] $log_ident = undef,
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
String $package_name,
Enum['git', 'none', 'package'] $install_method,
Enum['file', 'syslog', 'none'] $log_type,
Variant[
Enum['auth', 'user', 'authpriv'],
Pattern[/^local[0-7]$/]
] $log_facility = 'auth',
Enum['json', 'none'] $stream_format = 'none',
Optional[Stdlib::Absolutepath] $stream_file = undef,
] $log_facility,
Enum['json', 'none'] $stream_format,
Optional[Stdlib::Absolutepath] $stream_file = undef,
Optional[Stdlib::Absolutepath] $log_file = undef,
Optional[String] $log_ident = undef,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/audit",
Optional[String] $git_revision = undef,
) {
icingaweb2::assert_module()

Expand Down
12 changes: 6 additions & 6 deletions manifests/module/businessprocess.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
# }
#
class icingaweb2::module::businessprocess (
Enum['absent', 'present'] $ensure = 'present',
Optional[Stdlib::Absolutepath] $module_dir = undef,
String $git_repository = 'https://github.com/Icinga/icingaweb2-module-businessprocess.git',
Optional[String] $git_revision = undef,
Enum['git', 'none', 'package'] $install_method = 'git',
String $package_name = 'icingaweb2-module-businessprocess',
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
String $package_name,
Enum['git', 'none', 'package'] $install_method,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/businessprocess",
Optional[String] $git_revision = undef,
) {
icingaweb2::assert_module()

Expand Down
12 changes: 6 additions & 6 deletions manifests/module/cube.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
# }
#
class icingaweb2::module::cube (
Enum['absent', 'present'] $ensure = 'present',
Optional[Stdlib::Absolutepath] $module_dir = undef,
String $git_repository = 'https://github.com/Icinga/icingaweb2-module-cube.git',
Optional[String] $git_revision = undef,
Enum['git', 'none', 'package'] $install_method = 'git',
String $package_name = 'icingaweb2-module-cube',
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
String $package_name,
Enum['git', 'none', 'package'] $install_method,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/cube",
Optional[String] $git_revision = undef,
) {
icingaweb2::assert_module()

Expand Down
4 changes: 2 additions & 2 deletions manifests/module/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@
String $service_user,
Stdlib::Host $api_host,
Stdlib::Port $api_port,
Boolean $import_schema,
Boolean $kickstart,
Enum['mysql', 'pgsql'] $db_type,
Stdlib::Host $db_host,
String $db_name,
String $db_username,
Optional[Stdlib::Port] $db_port = undef,
Optional[Icingaweb2::Secret] $db_password = undef,
Optional[String] $db_charset = undef,
Boolean $import_schema = false,
Boolean $kickstart = false,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/director",
Optional[String] $git_revision = undef,
Optional[Boolean] $use_tls = undef,
Expand Down
2 changes: 1 addition & 1 deletion manifests/module/doc.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Enable or disable module. Defaults to `present`
#
class icingaweb2::module::doc (
Enum['absent', 'present'] $ensure = 'present',
Enum['absent', 'present'] $ensure,
) {
icingaweb2::assert_module()

Expand Down
16 changes: 8 additions & 8 deletions manifests/module/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
# }
#
class icingaweb2::module::elasticsearch (
Enum['absent', 'present'] $ensure = 'present',
Optional[Stdlib::Absolutepath] $module_dir = undef,
String $git_repository = 'https://github.com/Icinga/icingaweb2-module-elasticsearch.git',
Optional[String] $git_revision = undef,
Enum['git', 'none', 'package'] $install_method = 'git',
String $package_name = 'icingaweb2-module-elasticsearch',
Optional[Hash] $instances = undef,
Optional[Hash] $eventtypes = undef,
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
Enum['git', 'none', 'package'] $install_method,
String $package_name,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/elasticsearch",
Optional[String] $git_revision = undef,
Optional[Hash] $instances = undef,
Optional[Hash] $eventtypes = undef,
) {
icingaweb2::assert_module()

Expand Down
19 changes: 9 additions & 10 deletions manifests/module/fileshipper.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,18 @@
# }
#
class icingaweb2::module::fileshipper (
Enum['absent', 'present'] $ensure = 'present',
Optional[Stdlib::Absolutepath] $module_dir = undef,
String $git_repository = 'https://github.com/Icinga/icingaweb2-module-fileshipper.git',
Optional[String] $git_revision = undef,
Enum['git', 'none', 'package'] $install_method = 'git',
String $package_name = 'icingaweb2-module-fileshipper',
Hash $base_directories = {},
Hash $directories = {},
Enum['absent', 'present'] $ensure,
Stdlib::HTTPUrl $git_repository,
Enum['git', 'none', 'package'] $install_method,
String $package_name,
Hash $base_directories,
Hash $directories,
Stdlib::Absolutepath $module_dir = "${icingaweb2::globals::default_module_path}/fileshipper",
Optional[String] $git_revision = undef,
) {
icingaweb2::assert_module()

$conf_dir = $icingaweb2::globals::conf_dir
$module_conf_dir = "${conf_dir}/modules/fileshipper"
$module_conf_dir = "${icingaweb2::globals::conf_dir}/modules/fileshipper"

if $base_directories {
$base_directories.each |$identifier, $directory| {
Expand Down
3 changes: 1 addition & 2 deletions manifests/module/fileshipper/basedir.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
) {
assert_private("You're not supposed to use this defined type manually.")

$conf_dir = $icingaweb2::globals::conf_dir
$module_conf_dir = "${conf_dir}/modules/fileshipper"
$module_conf_dir = $icingaweb2::module::fileshipper::module_conf_dir

icingaweb2::inisection { "fileshipper-basedir-${identifier}":
section_name => $identifier,
Expand Down
3 changes: 1 addition & 2 deletions manifests/module/fileshipper/directory.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
) {
assert_private("You're not supposed to use this defined type manually.")

$conf_dir = $icingaweb2::globals::conf_dir
$module_conf_dir = "${conf_dir}/modules/fileshipper"
$module_conf_dir = $icingaweb2::module::fileshipper::module_conf_dir

icingaweb2::inisection { "fileshipper-directory-${identifier}":
section_name => $identifier,
Expand Down
Loading

0 comments on commit 992a538

Please sign in to comment.