summaryrefslogtreecommitdiff
path: root/sitemodules
diff options
context:
space:
mode:
authorJan Dittberner <jandd@cacert.org>2019-07-18 23:39:46 +0200
committerJan Dittberner <jandd@cacert.org>2019-07-18 23:39:46 +0200
commit45019721f180b6752e3ae51b2f57f56565780f4b (patch)
tree0d2cd457074d68c93d812d38920483c457918ace /sitemodules
parent26f754818e84dd823b0423391c4890280c15bc79 (diff)
downloadcacert-puppet-45019721f180b6752e3ae51b2f57f56565780f4b.tar.gz
cacert-puppet-45019721f180b6752e3ae51b2f57f56565780f4b.tar.xz
cacert-puppet-45019721f180b6752e3ae51b2f57f56565780f4b.zip
Add new profile to install Icinga2 on monitor
Diffstat (limited to 'sitemodules')
-rw-r--r--sitemodules/profiles/manifests/icinga2_master.pp114
-rw-r--r--sitemodules/roles/manifests/monitor.pp3
2 files changed, 116 insertions, 1 deletions
diff --git a/sitemodules/profiles/manifests/icinga2_master.pp b/sitemodules/profiles/manifests/icinga2_master.pp
new file mode 100644
index 0000000..d03ffdb
--- /dev/null
+++ b/sitemodules/profiles/manifests/icinga2_master.pp
@@ -0,0 +1,114 @@
+# Class: profiles::icinga2_master
+# ===============================
+#
+# This class installs and configures the Icinga2 master with
+# PostgreSQL IDO backend
+#
+# Parameters
+# ----------
+#
+# @param ido_database_name database name for Icinga2 IDO
+# @param ido_database_user database user for Icinga2 IDO
+# @param ido_database_password database password for Icinga2 IDO
+# @param web2_database_name database name for IcingaWeb2 database
+# @param web2_database_user database user for IcingaWeb2 database
+# @param web2_database_password database password for IcingaWeb2 database
+# @param icinga2_ticket_salt salt for certificate request tickets for
+# Icinga2 node authentication
+#
+# Examples
+# --------
+#
+# @example
+# class roles::myhost {
+# include profiles::icinga2_master
+# }
+#
+# Authors
+# -------
+#
+# Jan Dittberner <jandd@cacert.org>
+#
+# Copyright
+# ---------
+#
+# Copyright 2019 Jan Dittberner
+class profiles::icinga2_master (
+ String $ido_database_name,
+ String $ido_database_user,
+ String $ido_database_password,
+ String $web2_database_name,
+ String $web2_database_user,
+ String $web2_database_password,
+ String $icinga2_ticket_salt,
+) {
+ debconf { 'icinga2-ido-pgsql-password':
+ package => 'icinga2-ido-pgsql',
+ item => 'icinga2-ido-pgsql/pgsql/app-pass',
+ type => 'password',
+ value => $ido_database_password,
+ seen => true,
+ }
+ debconf { 'icinga2-ido-pgsql-password-confirm':
+ package => 'icinga2-ido-pgsql',
+ item => 'icinga2-ido-pgsql/app-password-confirm',
+ type => 'password',
+ value => $ido_database_password,
+ seen => true,
+ }
+ debconf { 'icinga2-ido-pgsql-host':
+ package => 'icinga2-ido-pgsql',
+ item => 'icinga2-ido-pgsql/remote/host',
+ value => 'localhost',
+ type => 'string',
+ seen => true,
+ }
+ debconf { 'icinga2-ido-pgsql-dbname':
+ package => 'icinga2-ido-pgsql',
+ item => 'icinga2-ido-pgsql/db/dbname',
+ value => $ido_database_name,
+ type => 'string',
+ seen => true,
+ }
+ debconf { 'icinga2-ido-pgsql-dbuser':
+ package => 'icinga2-ido-pgsql',
+ item => 'icinga2-ido-pgsql/db/app-user',
+ value => "${ido_database_user}@localhost",
+ type => 'string',
+ seen => true,
+ }
+ debconf { 'icinga2-ido-pgsql-enable':
+ package => 'icinga2-ido-pgsql',
+ item => 'icinga2-ido-pgsql/enable',
+ type => 'boolean',
+ value => 'true', # lint:ignore:quoted_booleans
+ seen => true,
+ }
+ debconf { 'icinga2-ido-pgsql-dbconfig-reinstall':
+ package => 'icinga2-ido-pgsql',
+ item => 'icinga2-ido-pgsql/dbconfig-reinstall',
+ type => 'boolean',
+ value => 'true', # lint:ignore:quoted_booleans
+ seen => true,
+ }
+ debconf { 'icinga2-ido-pgsql-dbconfig-install':
+ package => 'icinga2-ido-pgsql',
+ item => 'icinga2-ido-pgsql/dbconfig-install',
+ type => 'boolean',
+ value => 'true', # lint:ignore:quoted_booleans
+ seen => true,
+ }
+ package { ['icinga2', 'icinga2-ido-pgsql']:
+ ensure => installed,
+ require => [
+ Debconf['icinga2-ido-pgsql-password'],
+ Debconf['icinga2-ido-pgsql-password-confirm'],
+ Debconf['icinga2-ido-pgsql-host'],
+ Debconf['icinga2-ido-pgsql-dbname'],
+ Debconf['icinga2-ido-pgsql-dbuser'],
+ Debconf['icinga2-ido-pgsql-enable'],
+ Debconf['icinga2-ido-pgsql-dbconfig-install'],
+ Debconf['icinga2-ido-pgsql-dbconfig-reinstall'],
+ ],
+ }
+}
diff --git a/sitemodules/roles/manifests/monitor.pp b/sitemodules/roles/manifests/monitor.pp
index 6993229..5736e88 100644
--- a/sitemodules/roles/manifests/monitor.pp
+++ b/sitemodules/roles/manifests/monitor.pp
@@ -18,10 +18,11 @@
# Copyright
# ---------
#
-# Copyright 2018 Jan Dittberner
+# Copyright 2018-2019 Jan Dittberner
#
class roles::monitor {
include profiles::base
include profiles::rsyslog
include profiles::nrpe_agent
+ include profiles::icinga2_master
}