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/ 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 - } 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,