Paladox has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/361221 )
Change subject: Move somethings to puppet and puppicise some things ...................................................................... Move somethings to puppet and puppicise some things Change-Id: I127f438b01151a0dd8d38fc219b1b960f9d3f89c --- A files/icinga2.gpg D files/icingaweb2.gpg M manifests/init.pp M manifests/plugins.pp M manifests/web.pp A templates/backends.ini.erb A templates/commandtransports.ini.erb A templates/ido-mysql.erb A templates/roles.ini.erb 9 files changed, 122 insertions(+), 28 deletions(-) Approvals: Paladox: Verified; Looks good to me, approved diff --git a/files/icinga2.gpg b/files/icinga2.gpg new file mode 100644 index 0000000..901c78c --- /dev/null +++ b/files/icinga2.gpg @@ -0,0 +1,30 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v2.0.19 (GNU/Linux) + +mQGiBFKHzk4RBACSHMIFTtfw4ZsNKAA03Gf5t7ovsKWnS7kcMYleAidypqhOmkGg +0petiYsMPYT+MOepCJFGNzwQwJhZrdLUxxMSWay4Xj0ArgpD9vbvU+gj8Tb02l+x +SqNGP8jXMV5UnK4gZsrYGLUPvx47uNNYRIRJAGOPYTvohhnFJiG402dzlwCg4u5I +1RdFplkp9JM6vNM9VBIAmcED/2jr7UQGsPs8YOiPkskGHLh/zXgO8SvcNAxCLgbp +BjGcF4Iso/A2TAI/2KGJW6kBW/Paf722ltU6s/6mutdXJppgNAz5nfpEt4uZKZyu +oSWf77179B2B/Wl1BsX/Oc3chscAgQb2pD/qPF/VYRJU+hvdQkq1zfi6cVsxyREV +k+IwA/46nXh51CQxE29ayuy1BoIOxezvuXFUXZ8rP6aCh4KaiN9AJoy7pBieCzsq +d7rPEeGIzBjI+yhEu8p92W6KWzL0xduWfYg9I7a2GTk8CaLX2OCLuwnKd7RVDyyZ +yzRjWs0T5U7SRAWspLStYxMdKert9lLyQiRHtLwmlgBPqa0gh7Q+SWNpbmdhIE9w +ZW4gU291cmNlIE1vbml0b3JpbmcgKEJ1aWxkIHNlcnZlcikgPGluZm9AaWNpbmdh +Lm9yZz6IYAQTEQIAIAUCUofOTgIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJ +EMbjGcM0QQaCgSQAnRjXdbsyqziqhmxfAKffNJYuMPwdAKCS/IRCVyQzApFBtIBQ +1xuoym/4C7kCDQRSh85OEAgAvPwjlURCi8z6+7i60no4n16dNcSzd6AT8Kizpv2r +9BmNBff/GNYGnHyob/DMtmO2esEuVG8w62rO9m1wzzXzjbtmtU7NZ1Tg+C+reU2I +GNVu3SYtEVK/UTJHAhLcgry9yD99610tYPN2Fx33Efse94mXOreBfCvDsmFGSc7j +GVNCWXpMR3jTYyGj1igYd5ztOzG63D8gPyOucTTl+RWN/G9EoGBv6sWqk5eCd1Fs +JlWyQX4BJn3YsCZx3uj1DWL0dAl2zqcn6m1M4oj1ozW47MqM/efKOcV6VvCs9SL8 +F/NFvZcH4LKzeupCQ5jEONqcTlVlnLlIqId95Z4DI4AV9wADBQf/S6sKA4oH49tD +Yb5xAfUyEp5ben05TzUJbXs0Z7hfRQzy9+vQbWGamWLgg3QRUVPx1e4IT+W5vEm5 +dggNTMEwlLMI7izCPDcD32B5oxNVxlfj428KGllYWCFj+edY+xKTvw/PHnn+drKs +LE65Gwx4BPHm9EqWHIBX6aPzbgbJZZ06f6jWVBi/N7e/5n8lkxXqS23DBKemapyu +S1i56sH7mQSMaRZP/iiOroAJemPNxv1IQkykxw2woWMmTLKLMCD/i+4DxejE50tK +dxaOLTc4HDCsattw/RVJO6fwE414IXHMv330z4HKWJevMQ+CmQGfswvCwgeBP9n8 +PItLjBQAXIhJBBgRAgAJBQJSh85OAhsMAAoJEMbjGcM0QQaCzpAAmwUNoRyySf9p +5G3/2UD1PMueIwOtAKDVVDXEq5LJPVg4iafNu0SRMwgP0Q== +=icbY +-----END PGP PUBLIC KEY BLOCK----- diff --git a/files/icingaweb2.gpg b/files/icingaweb2.gpg deleted file mode 100644 index ac52912..0000000 --- a/files/icingaweb2.gpg +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1 - -iEYEABEIAAYFAlkHqt0ACgkQxuMZwzRBBoLAuQCgndU7a0I7ryWQQ4KxtQFsRV/C -DFIAoM8xdATxQsAJ5qEU0py/hD3Jbm2H -=ZEPy ------END PGP SIGNATURE----- diff --git a/manifests/init.pp b/manifests/init.pp index 837711b..f1686a9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -11,7 +11,16 @@ class icinga2( $enable_notifications = 1, $enable_event_handlers = 1, + $os = hiera('icinga_apt_dist') ) { + apt::repository { 'icinga2': + uri => 'http://packages.icinga.com/debian', + dist => $os, + components => 'main', + source => false, + keyfile => 'puppet:///modules/icinga2/icinga2.gpg', + } + group { 'nagios': ensure => present, name => 'nagios', @@ -37,6 +46,21 @@ package { 'icinga2': ensure => 'present', + require => Apt::Repository['icinga2'], + } + + package { 'icinga2-ido-mysql': + ensure => 'present', + require => [ Apt::Repository['icinga2'], Package['icinga2'] ], + } + + file { '/etc/icinga2/features-available/ido-mysql.conf': + ensure => present, + content => template('icinga2/ido-mysql.erb'), + owner => 'root', + group => 'root', + require => Package['icinga2-ido-mysql'], + notify => Base::Service_unit['icinga2'], } file { '/etc/icinga2/conf.d/commands.conf': diff --git a/manifests/plugins.pp b/manifests/plugins.pp index 17fe054..9a312d2 100644 --- a/manifests/plugins.pp +++ b/manifests/plugins.pp @@ -5,6 +5,7 @@ package { 'nagios-nrpe-plugin': ensure => present, } + file { '/usr/lib/nagios': ensure => directory, owner => 'root', diff --git a/manifests/web.pp b/manifests/web.pp index 57f5a75..5cc53c2 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -14,30 +14,13 @@ $director_db_host = hiera('director_db_host'), $director_db_name = hiera('director_db_name'), $director_user_name = hiera('director_user_name'), - $director_password = hiera('director_password') + $director_password = hiera('director_password'), ) { include ::icinga2 - if os_version('debian >= stretch') { - apt::repository { 'icingaweb2': - uri => 'http://packages.icinga.com/debian', - dist => 'icinga-stretch', - components => 'main', - source => false, - keyfile => 'puppet:///modules/icinga2/icingaweb2.gpg', - } - } else { - apt::repository { 'icingaweb2': - uri => 'http://packages.icinga.com/debian', - dist => 'icinga-jessie', - components => 'main', - source => false, - keyfile => 'puppet:///modules/icinga2/icingaweb2.gpg', - } - } - package { 'icingaweb2': ensure => present, + require => Apt::Repository['icinga2'], } package { 'icinga2-doc': @@ -63,12 +46,24 @@ if os_version('debian >= stretch') { require_package('php7.0') - require_package('php7.0-dev') - require_package('php7.0-gd') + require_package('php-dev') + require_package('php-imagick') + require_package('php-gd') + require_package('php-json') + require_package('php-mbstring') + require_package('php-common') + require_package('php-mysql') + require_package('php-ldap') } else { require_package('php5') require_package('php5-dev') + require_package('php5-imagick') require_package('php5-gd') + require_package('php5-json') + require_package('php5-mbstring') + require_package('php5-common') + require_package('php5-mysql') + require_package('php5-ldap') } file { '/etc/icingaweb2': @@ -95,6 +90,27 @@ file { '/etc/icingaweb2/resources.ini': ensure => present, content => template('icinga2/resources.ini.erb'), + owner => 'www-data', + group => 'icingaweb2', + } + + file { '/etc/icingaweb2/modules/monitoring/backends.ini': + ensure => present, + content => template('icinga2/backends.ini.erb'), + owner => 'www-data', + group => 'icingaweb2', + } + + file { '/etc/icingaweb2/modules/monitoring/commandtransports.ini': + ensure => present, + content => template('icinga2/commandtransports.ini.erb'), + owner => 'www-data', + group => 'icingaweb2', + } + + file { '/etc/icingaweb2/modules/monitoring/roles.ini': + ensure => present, + content => template('icinga2/roles.ini.erb'), owner => 'www-data', group => 'icingaweb2', } @@ -132,6 +148,10 @@ content => template('icinga2/icinga.wmflabs.org.erb'), } + if os_version('debian >= stretch') { + require_package('libapache2-mod-php') + } + file { '/etc/apache2/conf.d/icinga2.conf': ensure => absent, } diff --git a/templates/backends.ini.erb b/templates/backends.ini.erb new file mode 100644 index 0000000..6440ec9 --- /dev/null +++ b/templates/backends.ini.erb @@ -0,0 +1,4 @@ +[icing] +type = "ido" +resource = "icinga_ido" +disabled = "0" diff --git a/templates/commandtransports.ini.erb b/templates/commandtransports.ini.erb new file mode 100644 index 0000000..d1bab6a --- /dev/null +++ b/templates/commandtransports.ini.erb @@ -0,0 +1,3 @@ +[command] +transport = "local" +path = "/var/run/icinga2/cmd/icinga2.cmd" diff --git a/templates/ido-mysql.erb b/templates/ido-mysql.erb new file mode 100644 index 0000000..3138eb4 --- /dev/null +++ b/templates/ido-mysql.erb @@ -0,0 +1,13 @@ +/** + * The db_ido_mysql library implements IDO functionality + * for MySQL. + */ + +library "db_ido_mysql" + +object IdoMysqlConnection "ido-mysql" { + user = "<%= @icinga_ido_user_name %>", + password = "<%= @icinga_ido_password %>", + host = "<%= @icinga_ido_db_host %>", + database = "<%= @icinga_ido_db_name %>" +} diff --git a/templates/roles.ini.erb b/templates/roles.ini.erb new file mode 100644 index 0000000..ca45240 --- /dev/null +++ b/templates/roles.ini.erb @@ -0,0 +1,6 @@ +[admin] +users = "paladox +awight +Zppix" +permissions = "*" +groups = "Administrators" -- To view, visit https://gerrit.wikimedia.org/r/361221 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I127f438b01151a0dd8d38fc219b1b960f9d3f89c Gerrit-PatchSet: 2 Gerrit-Project: labs/icinga2 Gerrit-Branch: master Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits