summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClark Boylan <clark.boylan@gmail.com>2018-05-30 10:56:42 -0700
committerClark Boylan <clark.boylan@gmail.com>2018-05-30 11:02:10 -0700
commitf36b4dce39b1b209ff94a3666156e6e937bf54f1 (patch)
tree1eaaaff5aed0c69be4e3a618c7daa512b58f7356
parent71cc8f97a462e5ab8a63d199a7a9b0ef6472c38e (diff)
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
Notes
Notes (review): Code-Review+2: Jeremy Stanley <fungi@yuggoth.org> Code-Review+2: Monty Taylor <mordred@inaugust.com> Workflow+1: Monty Taylor <mordred@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 30 May 2018 18:46:12 +0000 Reviewed-on: https://review.openstack.org/570004 Project: openstack-infra/puppet-storyboard Branch: refs/heads/master
-rw-r--r--manifests/application.pp10
1 files 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 (
217 onlyif => "curl -I ${webclient_url} -z ./${webclient_filename} | grep '200 OK'", 217 onlyif => "curl -I ${webclient_url} -z ./${webclient_filename} | grep '200 OK'",
218 } 218 }
219 219
220 # Create/clean the storyboard-webclient unpack directory 220 # Create the storyboard-webclient unpack directory
221 file { "${src_root_webclient}/dist": 221 file { "${src_root_webclient}/dist":
222 ensure => directory, 222 ensure => directory,
223 recurse => true,
224 purge => true,
225 force => true,
226 require => File[$src_root_webclient], 223 require => File[$src_root_webclient],
227 } 224 }
228 225
229 # Unpack storyboard-webclient 226 # Clean the unpack dir then unpack storyboard-webclient
230 exec { 'unpack-webclient': 227 exec { 'unpack-webclient':
231 command => "tar -xzf ../${webclient_filename}", 228 command => "rm -rf * && tar -xzf ../${webclient_filename}",
232 path => '/bin:/usr/bin', 229 path => '/bin:/usr/bin',
230 provider => shell,
233 refreshonly => true, 231 refreshonly => true,
234 cwd => "${src_root_webclient}/dist", 232 cwd => "${src_root_webclient}/dist",
235 require => [ 233 require => [