diff --git a/.vagrant-puppet/profiles/icingaweb2_dev/manifests/init.pp b/.vagrant-puppet/profiles/icingaweb2_dev/manifests/init.pp index 400a08b00..e65e920b9 100644 --- a/.vagrant-puppet/profiles/icingaweb2_dev/manifests/init.pp +++ b/.vagrant-puppet/profiles/icingaweb2_dev/manifests/init.pp @@ -1,37 +1,27 @@ class icingaweb2_dev { - mysql::database::create { 'icingaweb': + mysql::database::populate { 'icingaweb': username => 'icingaweb', password => 'icingaweb', privileges => 'ALL', + schemafile => '/vagrant/etc/schema/accounts.mysql.sql', } - pgsql::database::create { 'icingaweb': + pgsql::database::populate { 'icingaweb': username => 'icingaweb', password => 'icinga', - } - - exec { 'populate-icingaweb-mysql-db-accounts': - unless => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM account;" &> /dev/null', - command => 'mysql -uicingaweb -picingaweb icingaweb < /vagrant/etc/schema/accounts.mysql.sql', - require => [ Exec['create-mysql-icingaweb-db'] ] - } - - exec { 'populate-icingweba-pgsql-db-accounts': - unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM account;" &> /dev/null', - command => 'sudo -u postgres psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/accounts.pgsql.sql', - require => [ Exec['create-pgsql-icingaweb-db'] ] + schemafile => '/vagrant/etc/schema/accounts.pgsql.sql', } exec { 'populate-icingaweb-mysql-db-preferences': unless => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM preference;" &> /dev/null', command => 'mysql -uicingaweb -picingaweb icingaweb < /vagrant/etc/schema/preferences.mysql.sql', - require => [ Exec['create-mysql-icingaweb-db'] ] + require => Mysql::Database::Populate['icingaweb'], } - exec { 'populate-icingweba-pgsql-db-preferences': + exec { 'populate-icingweb-pgsql-db-preferences': unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM preference;" &> /dev/null', command => 'sudo -u postgres psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/preferences.pgsql.sql', - require => [ Exec['create-pgsql-icingaweb-db'] ] + require => Pgsql::Database::Populate['icingaweb'], } file { '/etc/httpd/conf.d/icingaweb.conf':