From 7e7064297f592d4fd793422c491ccbf219710e08 Mon Sep 17 00:00:00 2001 From: Michael Krotscheck Date: Thu, 14 Aug 2014 15:49:02 -0700 Subject: [PATCH] StoryBoard Webclient now auto-updates again. puppi:netinstall appears to be less useful than expected, as the remote versions are no longer being downloaded and updated. This change moves us back to using curl to download the webclient tarball, so that we're assured to always have a fresh version. Change-Id: I4120f82239614ec355b921b8ee54bb81e4b39543 --- manifests/application.pp | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/manifests/application.pp b/manifests/application.pp index 465f7ec..7b960ad 100644 --- a/manifests/application.pp +++ b/manifests/application.pp @@ -43,6 +43,10 @@ class storyboard::application ( $rabbitmq_user_password = 'changemetoo' ) { + # Variables + $webclient_filename = 'storyboard-webclient-latest.tar.gz' + $webclient_url = "http://tarballs.openstack.org/storyboard-webclient/${webclient_filename}" + # Dependencies require storyboard::params include apache @@ -61,6 +65,12 @@ class storyboard::application ( } } + if !defined(Package['curl']) { + package { 'curl': + ensure => present + } + } + # Create the storyboard configuration directory. file { '/etc/storyboard': ensure => directory, @@ -147,11 +157,29 @@ class storyboard::application ( notify => Service['httpd'], } + file { '/opt/storyboard-webclient': + ensure => directory, + owner => $storyboard::params::user, + group => $storyboard::params::group, + } + # Download the latest storyboard-webclient - puppi::netinstall { 'storyboard-webclient': - url => 'http://tarballs.openstack.org/storyboard-webclient/storyboard-webclient-latest.tar.gz', - destination_dir => '/opt/storyboard-webclient', - extracted_dir => 'dist', + exec { 'get-webclient': + command => "curl ${webclient_url} -z ./${webclient_filename} -o ${webclient_filename}", + path => '/bin:/usr/bin', + cwd => '/opt/storyboard-webclient', + require => File['/opt/storyboard-webclient'], + onlyif => "curl -I ${webclient_url} -z ./${webclient_filename} | grep '200 OK'", + } + + # Unpack storyboard-webclient + exec { 'unpack-webclient': + command => "tar -xzf ./${webclient_filename}", + path => '/bin:/usr/bin', + refreshonly => true, + cwd => '/opt/storyboard-webclient', + require => Exec['get-webclient'], + subscribe => Exec['get-webclient'], } # Copy the downloaded source into the configured www_root @@ -159,7 +187,7 @@ class storyboard::application ( ensure => directory, owner => $storyboard::params::user, group => $storyboard::params::group, - require => Puppi::Netinstall['storyboard-webclient'], + require => Exec['unpack-webclient'], source => '/opt/storyboard-webclient/dist', recurse => true, purge => true, @@ -190,4 +218,4 @@ class storyboard::application ( ssl => false, } } -} \ No newline at end of file +}