Added an exec to enable the Postgres IDO module.
This commit is contained in:
parent
324e8b50b8
commit
cea6ab147e
2 changed files with 12 additions and 5 deletions
|
@ -23,11 +23,10 @@ class icinga2::server (
|
||||||
#$server_db_schema_path = $icinga2::params::server_db_schema_path
|
#$server_db_schema_path = $icinga2::params::server_db_schema_path
|
||||||
) inherits icinga2::params {
|
) inherits icinga2::params {
|
||||||
|
|
||||||
|
#Pick set the right path where we can find the DB schema based on the OS...
|
||||||
case $operatingsystem {
|
case $operatingsystem {
|
||||||
#Red Hat/CentOS systems:
|
|
||||||
'RedHat', 'CentOS': {
|
'RedHat', 'CentOS': {
|
||||||
#Pick set the right path where we can find the DB schema
|
#...and database that the user picks
|
||||||
case $server_db_type {
|
case $server_db_type {
|
||||||
'mysql': { $server_db_schema_path = '/usr/share/doc/icinga2-ido-mysql-2.0.0/schema/mysql.sql' }
|
'mysql': { $server_db_schema_path = '/usr/share/doc/icinga2-ido-mysql-2.0.0/schema/mysql.sql' }
|
||||||
'pgsql': { $server_db_schema_path = '/usr/share/doc/icinga2-ido-pgsql-2.0.0/schema/pgsql.sql' }
|
'pgsql': { $server_db_schema_path = '/usr/share/doc/icinga2-ido-pgsql-2.0.0/schema/pgsql.sql' }
|
||||||
|
|
|
@ -109,6 +109,7 @@ class icinga2::server::install::execs inherits icinga2::server {
|
||||||
require => Class['icinga2::server::install::packages'],
|
require => Class['icinga2::server::install::packages'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Schema loading for Postgres:
|
#Schema loading for Postgres:
|
||||||
'pgsql': {
|
'pgsql': {
|
||||||
exec { 'postgres_schema_load':
|
exec { 'postgres_schema_load':
|
||||||
|
@ -118,9 +119,16 @@ class icinga2::server::install::execs inherits icinga2::server {
|
||||||
creates => "/etc/icinga2/postgres_schema_loaded.txt",
|
creates => "/etc/icinga2/postgres_schema_loaded.txt",
|
||||||
require => Class['icinga2::server::install::packages'],
|
require => Class['icinga2::server::install::packages'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec { 'postgres_module_enable':
|
||||||
|
user => 'root',
|
||||||
|
path => '/usr/bin:/usr/sbin:/bin/:/sbin',
|
||||||
|
command => "/usr/sbin/icinga2-enable-feature ido-pgsql; touch /etc/icinga2/postgres_module_loaded.txt",
|
||||||
|
creates => "/etc/icinga2/postgres_module_loaded.txt",
|
||||||
|
require => Exec['postgres_schema_load'],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
default: { fail("${server_db_type} is not supported!") }
|
default: { fail("${server_db_type} is not supported!") }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue