mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 00:04:04 +02:00
Split pgsql::database into pgsql::database::create and pgsql::database::populate
refs #6842
This commit is contained in:
parent
e42f400f38
commit
ccbc1f5aa0
@ -26,7 +26,7 @@ mysql::database { 'icinga2':
|
|||||||
requirement => Package['icinga2-ido-mysql'],
|
requirement => Package['icinga2-ido-mysql'],
|
||||||
}
|
}
|
||||||
|
|
||||||
pgsql::database { 'icinga':
|
pgsql::database::populate { 'icinga':
|
||||||
username => 'icinga',
|
username => 'icinga',
|
||||||
password => 'icingaweb',
|
password => 'icingaweb',
|
||||||
schemafile => "/usr/local/src/icinga-pgsql/icinga-${icingaVersion}/module/idoutils/db/pgsql/pgsql.sql",
|
schemafile => "/usr/local/src/icinga-pgsql/icinga-${icingaVersion}/module/idoutils/db/pgsql/pgsql.sql",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
define pgsql::database ($username, $password, $schemafile, $requirement) {
|
define pgsql::database::create ($username, $password) {
|
||||||
include pgsql
|
include pgsql
|
||||||
|
|
||||||
exec { "create-pgsql-${name}-db":
|
exec { "create-pgsql-${name}-db":
|
||||||
@ -8,6 +8,15 @@ sudo -u postgres createdb -O ${username} -E UTF8 -T template0 ${name} && \
|
|||||||
sudo -u postgres createlang plpgsql ${name}",
|
sudo -u postgres createlang plpgsql ${name}",
|
||||||
require => Service['postgresql']
|
require => Service['postgresql']
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
define pgsql::database::populate ($username, $password, $schemafile, $requirement) {
|
||||||
|
include pgsql
|
||||||
|
|
||||||
|
pgsql::database::create { "create-pgsql-${name}-db":
|
||||||
|
username => $username,
|
||||||
|
password => $password,
|
||||||
|
}
|
||||||
|
|
||||||
exec { "populate-${name}-pgsql-db":
|
exec { "populate-${name}-pgsql-db":
|
||||||
unless => "psql -U ${username} -d ${name} -c \"SELECT * FROM icinga_dbversion;\" &> /dev/null",
|
unless => "psql -U ${username} -d ${name} -c \"SELECT * FROM icinga_dbversion;\" &> /dev/null",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user