From: Felix Dörre Date: Thu, 14 Dec 2017 21:31:59 +0000 (+0100) Subject: fix: ensure postgres-client for quiz-setup X-Git-Url: https://code.wpia.club/?p=infra.git;a=commitdiff_plain;h=3c32a024106395e61b34bdc5064083c65fafec35 fix: ensure postgres-client for quiz-setup Change-Id: I32d60ee3a55c98fa2ef6ad0e12037052a9f5949e --- diff --git a/environments/production/manifests/quiz.pp b/environments/production/manifests/quiz.pp index f576158..5d5e3a0 100644 --- a/environments/production/manifests/quiz.pp +++ b/environments/production/manifests/quiz.pp @@ -43,11 +43,12 @@ define teracara_quiz (){ source => ['puppet:///modules/nre/config/ca/root.crt'], show_diff => 'no' } + include postgresql::client exec { 'import quiz schema': command => "/usr/bin/psql -U quiz -h ${ips[postgres]} < /usr/share/teracara-quiz/sql/db_postgresql.sql", environment => ["PGPASSWORD=${passwords[postgres][quiz]}"], unless => "/usr/bin/psql -U quiz -h ${ips[postgres]} -tc \"select * from pg_tables where schemaname='public';\" | /bin/grep -q '.'", - require => [Package['teracara-quiz']], + require => [Package['teracara-quiz'], Class['postgresql::client']], before => File['/etc/apache2/sites-available/000-default.conf'] } file {'/etc/apache2/sites-available/000-default.conf':