mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 00:04:04 +02:00
Profile `icingaweb2_dev': deduplicate DB creation/population
refs #6842
This commit is contained in:
parent
be7bae8cd6
commit
77719be042
@ -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':
|
||||
|
Loading…
x
Reference in New Issue
Block a user