From f36b4dce39b1b209ff94a3666156e6e937bf54f1 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Wed, 30 May 2018 10:56:42 -0700 Subject: [PATCH] Clean the webclient unpack dir safely. Don't rely on a puppet file resource to purge the unpack dir as this will trigger on every puppet run then copy the empty unpack dir to the deployment dir. Instead we call rm prior to tar during the unpack exec so that we only ever clean the dir if we are unpacking. Change-Id: I80b4faf54220d88e610e2a224dea47af4133e225 --- manifests/application.pp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/manifests/application.pp b/manifests/application.pp index 79bd333..ae81d1e 100644 --- a/manifests/application.pp +++ b/manifests/application.pp @@ -217,19 +217,17 @@ class storyboard::application ( onlyif => "curl -I ${webclient_url} -z ./${webclient_filename} | grep '200 OK'", } - # Create/clean the storyboard-webclient unpack directory + # Create the storyboard-webclient unpack directory file { "${src_root_webclient}/dist": ensure => directory, - recurse => true, - purge => true, - force => true, require => File[$src_root_webclient], } - # Unpack storyboard-webclient + # Clean the unpack dir then unpack storyboard-webclient exec { 'unpack-webclient': - command => "tar -xzf ../${webclient_filename}", + command => "rm -rf * && tar -xzf ../${webclient_filename}", path => '/bin:/usr/bin', + provider => shell, refreshonly => true, cwd => "${src_root_webclient}/dist", require => [