From 3c32a024106395e61b34bdc5064083c65fafec35 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Thu, 14 Dec 2017 22:31:59 +0100 Subject: [PATCH] fix: ensure postgres-client for quiz-setup Change-Id: I32d60ee3a55c98fa2ef6ad0e12037052a9f5949e --- environments/production/manifests/quiz.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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': -- 2.39.5