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
This commit is contained in:
Michael Krotscheck 2014-08-14 15:49:02 -07:00
parent 05cee0f709
commit 7e7064297f

@ -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,
}
}
}
}