Merge pull request #28874 from ryantm/mattermost

nixos/mattermost: fix create role
This commit is contained in:
Joachim F 2017-09-13 19:41:25 +00:00 committed by GitHub
commit c9200f8d9c

View File

@ -185,7 +185,7 @@ in
'' + lib.optionalString cfg.localDatabaseCreate '' '' + lib.optionalString cfg.localDatabaseCreate ''
if ! test -e "${cfg.statePath}/.db-created"; then if ! test -e "${cfg.statePath}/.db-created"; then
${config.services.postgresql.package}/bin/psql postgres -c \ ${config.services.postgresql.package}/bin/psql postgres -c \
"CREATE ROLE ${cfg.localDatabaseUser} WITH LOGIN NOCREATEDB NOCREATEROLE NOCREATEUSER ENCRYPTED PASSWORD '${cfg.localDatabasePassword}'" "CREATE ROLE ${cfg.localDatabaseUser} WITH LOGIN NOCREATEDB NOCREATEROLE ENCRYPTED PASSWORD '${cfg.localDatabasePassword}'"
${config.services.postgresql.package}/bin/createdb \ ${config.services.postgresql.package}/bin/createdb \
--owner ${cfg.localDatabaseUser} ${cfg.localDatabaseName} --owner ${cfg.localDatabaseUser} ${cfg.localDatabaseName}
touch ${cfg.statePath}/.db-created touch ${cfg.statePath}/.db-created