From af166a9ac519625c539dab799f49d462a8887ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guzm=C3=A1n=20Bras=C3=B3?= Date: Thu, 27 Sep 2012 18:55:33 -0300 Subject: [PATCH] Summary: Fixed error from cat when trying nginx.d/* on nodes without vhosts defined Description: When running first time from scratch, if class was included without any setup at all and with sane defaults, in debian squeeze generates an error when trying to collect non existant vhosts, because cat complains that can not expand * because there are no files. Changed: Added unless to check that at least there is a file in nginx.d by testing it can expand. --- manifests/service.pp | 1 + 1 file changed, 1 insertion(+) diff --git a/manifests/service.pp b/manifests/service.pp index 6d78a00a3..66dfe02fa 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -17,6 +17,7 @@ exec { 'rebuild-nginx-vhosts': command => "/bin/cat ${nginx::params::nx_temp_dir}/nginx.d/* > ${nginx::params::nx_conf_dir}/conf.d/vhost_autogen.conf", refreshonly => true, + unless => "/usr/bin/test ! -f ${nginx::params::nx_temp_dir}/nginx.d/*", subscribe => File["${nginx::params::nx_temp_dir}/nginx.d"], } service { "nginx":