Added exec to load the MySQL schema.

This commit is contained in:
Nick Chappell 2014-07-03 20:37:48 -07:00
parent 16ce34d7a0
commit 44c98f5fee

View file

@ -100,7 +100,15 @@ class icinga2::server::install::execs inherits icinga2::server {
case $server_db_type {
#Schema loading for MySQL:
'mysql': { }
'mysql': {
exec { 'mysql_schema_load':
user => 'root',
path => '/usr/bin:/usr/sbin:/bin/:/sbin',
command => "mysql -u ${db_user} -p${db_password} ${db_name} < ${server_db_schema_path}; touch /etc/icinga2/mysql_schema_loaded.txt",
creates => "/etc/icinga2/mysql_schema_loaded.txt",
require => Class['icinga2::server::install::packages'],
}
}
#Schema loading for Postgres:
'pgsql': {
exec { 'postgres_schema_load':