Browse Source

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
master
Clark Boylan 11 months ago
parent
commit
f36b4dce39
1 changed files with 4 additions and 6 deletions
  1. 4
    6
      manifests/application.pp

+ 4
- 6
manifests/application.pp View File

@@ -217,19 +217,17 @@ class storyboard::application (
217 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 221
   file { "${src_root_webclient}/dist":
222 222
     ensure  => directory,
223
-    recurse => true,
224
-    purge   => true,
225
-    force   => true,
226 223
     require => File[$src_root_webclient],
227 224
   }
228 225
 
229
-  # Unpack storyboard-webclient
226
+  # Clean the unpack dir then unpack storyboard-webclient
230 227
   exec { 'unpack-webclient':
231
-    command     => "tar -xzf ../${webclient_filename}",
228
+    command     => "rm -rf * && tar -xzf ../${webclient_filename}",
232 229
     path        => '/bin:/usr/bin',
230
+    provider    => shell,
233 231
     refreshonly => true,
234 232
     cwd         => "${src_root_webclient}/dist",
235 233
     require     => [

Loading…
Cancel
Save