mirror of https://github.com/zulip/zulip.git
puppet: Fix pgroonga init for custom database names and users.
This commit is contained in:
parent
3d31bd79be
commit
86cf3be39f
|
@ -1,2 +0,0 @@
|
||||||
CREATE EXTENSION PGROONGA;
|
|
||||||
GRANT USAGE ON SCHEMA pgroonga TO ZULIP;
|
|
|
@ -88,19 +88,21 @@ class zulip::postgresql_base {
|
||||||
Exec[$setup_system_deps]],
|
Exec[$setup_system_deps]],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$dbname = zulipconf('postgresql', 'database_name', 'zulip')
|
||||||
|
$dbuser = zulipconf('postgresql', 'database_user', 'zulip')
|
||||||
file { $pgroonga_setup_sql_path:
|
file { $pgroonga_setup_sql_path:
|
||||||
ensure => file,
|
ensure => file,
|
||||||
require => Package["${postgresql}-pgdg-pgroonga"],
|
require => Package["${postgresql}-pgdg-pgroonga"],
|
||||||
owner => 'postgres',
|
owner => 'postgres',
|
||||||
group => 'postgres',
|
group => 'postgres',
|
||||||
mode => '0640',
|
mode => '0640',
|
||||||
source => 'puppet:///modules/zulip/postgresql/pgroonga_setup.sql',
|
content => template('zulip/postgresql/pgroonga_setup.sql.template.erb'),
|
||||||
}
|
}
|
||||||
|
|
||||||
exec{'create_pgroonga_extension':
|
exec{'create_pgroonga_extension':
|
||||||
require => File[$pgroonga_setup_sql_path],
|
require => File[$pgroonga_setup_sql_path],
|
||||||
# lint:ignore:140chars
|
# lint:ignore:140chars
|
||||||
command => "bash -c 'cat ${pgroonga_setup_sql_path} | su postgres -c \"psql -v ON_ERROR_STOP=1 zulip\" && touch ${pgroonga_setup_sql_path}.applied'",
|
command => "bash -c 'cat ${pgroonga_setup_sql_path} | su postgres -c \"psql -v ON_ERROR_STOP=1 ${dbname}\" && touch ${pgroonga_setup_sql_path}.applied'",
|
||||||
# lint:endignore
|
# lint:endignore
|
||||||
creates => "${pgroonga_setup_sql_path}.applied",
|
creates => "${pgroonga_setup_sql_path}.applied",
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
CREATE EXTENSION PGROONGA;
|
||||||
|
GRANT USAGE ON SCHEMA pgroonga TO <%= @dbuser %>;
|
Loading…
Reference in New Issue