From 04eaae1a66be202848a1e72c5dca4cb965fea1b8 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Sat, 24 Jun 2017 11:36:54 +0200 Subject: [PATCH 1/3] Update gitignore --- .gitignore | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index cdd2d365b..8912186e6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,17 @@ -.vagrant -.idea +## editors +/.idea/ +*~ *.swp +.DS_Store + +## puppet +.vagrant modules/ spec/fixtures/ -.DS_Store +pkg/ + +## ruby Gemfile.lock +/.ruby-* .bundle vendor/ -pkg/ From fd9ed31e580c4142baa37bf624f1afe846aa1f05 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Sat, 24 Jun 2017 11:42:58 +0200 Subject: [PATCH 2/3] debian::dbconfig: Move to autoload location and lint it --- manifests/{debian.pp => debian/dbconfig.pp} | 39 +++++++++++---------- 1 file changed, 20 insertions(+), 19 deletions(-) rename manifests/{debian.pp => debian/dbconfig.pp} (72%) diff --git a/manifests/debian.pp b/manifests/debian/dbconfig.pp similarity index 72% rename from manifests/debian.pp rename to manifests/debian/dbconfig.pp index 9239edcef..24ab14fc1 100644 --- a/manifests/debian.pp +++ b/manifests/debian/dbconfig.pp @@ -24,18 +24,21 @@ # dbconfig config for Debian or Ubuntu if $::osfamily == 'debian' { - include ::icinga2::params + include ::icinga2::params - case $dbtype { - 'mysql': { - $default_port = 3306 - $path = "/etc/dbconfig-common/${::icinga2::params::ido_mysql_package}.conf" - } - 'pgsql': { - $default_port = 5432 - $path = "/etc/dbconfig-common/${::icinga2::params::ido_pgsql_package}.conf" - } - } + case $dbtype { + 'mysql': { + $default_port = 3306 + $path = "/etc/dbconfig-common/${::icinga2::params::ido_mysql_package}.conf" + } + 'pgsql': { + $default_port = 5432 + $path = "/etc/dbconfig-common/${::icinga2::params::ido_pgsql_package}.conf" + } + default: { + fail("Unsupported dbtype: ${dbtype}") + } + } file_line { "dbc-${dbtype}-dbuser": path => $path, @@ -63,20 +66,18 @@ # only set port if isn't the default if $dbport != $default_port { file_line { "dbc-${dbtype}-dbport": - path => $path, - line => "dbc_dbport='${dbport}'", - match => '^dbc_dbport\s*=', + path => $path, + line => "dbc_dbport='${dbport}'", + match => '^dbc_dbport\s*=', } } # set ssl if $ssl { file_line { "dbc-${dbtype}-ssl": - path => $path, - line => "dbc_ssl='true'", - match => '^dbc_ssl\s*=', + path => $path, + line => "dbc_ssl='true'", + match => '^dbc_ssl\s*=', } } - } # debian dbconfig - } From 44bff1f7c6c7c30ee855fa34d457db9cb6797848 Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Sat, 24 Jun 2017 11:43:17 +0200 Subject: [PATCH 3/3] feature/ido: Fixes for puppet-lint --- manifests/feature/idomysql.pp | 3 +-- manifests/feature/idopgsql.pp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/manifests/feature/idomysql.pp b/manifests/feature/idomysql.pp index 4ca8ac069..9e77c0f6f 100644 --- a/manifests/feature/idomysql.pp +++ b/manifests/feature/idomysql.pp @@ -320,8 +320,7 @@ ensure => installed, before => Icinga2::Feature['ido-mysql'], } - -> - class { '::icinga2::debian::dbconfig': + -> class { '::icinga2::debian::dbconfig': dbtype => 'mysql', dbserver => $host, dbport => $port, diff --git a/manifests/feature/idopgsql.pp b/manifests/feature/idopgsql.pp index 10629c0d9..2e9cc1723 100644 --- a/manifests/feature/idopgsql.pp +++ b/manifests/feature/idopgsql.pp @@ -137,8 +137,7 @@ ensure => installed, before => Icinga2::Feature['ido-pgsql'], } - -> - class { '::icinga2::debian::dbconfig': + -> class { '::icinga2::debian::dbconfig': dbtype => 'pgsql', dbserver => $host, dbport => $port,