From 645a2ec3804157e6958056b39b0ae1cb2c720091 Mon Sep 17 00:00:00 2001 From: Alexander Klimov Date: Wed, 10 Sep 2014 10:20:22 +0200 Subject: [PATCH] mysql::database::populate: require module `grep' refs #6842 --- .../modules/mysql/manifests/database/populate.pp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.vagrant-puppet/modules/mysql/manifests/database/populate.pp b/.vagrant-puppet/modules/mysql/manifests/database/populate.pp index 39b819e1e..7099cc4dd 100644 --- a/.vagrant-puppet/modules/mysql/manifests/database/populate.pp +++ b/.vagrant-puppet/modules/mysql/manifests/database/populate.pp @@ -12,6 +12,7 @@ # Requires: # # mysql::database::create +# grep # # Sample Usage: # @@ -23,6 +24,8 @@ # } # define mysql::database::populate ($username, $password, $privileges, $schemafile) { + include grep + Exec { path => '/usr/bin' } mysql::database::create { $name: @@ -34,6 +37,9 @@ define mysql::database::populate ($username, $password, $privileges, $schemafile exec { "populate-${name}-mysql-db": onlyif => "mysql -u${username} -p${password} ${name} -e \"SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '${name}';\" 2>/dev/null |grep -qEe '^ *0 *$'", command => "mysql -uroot ${name} < ${schemafile}", - require => Mysql::Database::Create[$name], + require => [ + Mysql::Database::Create[$name], + Class['grep'] + ], } }