From 4546cf9f2a4db2607f12cf1a33f2c426ae50edb9 Mon Sep 17 00:00:00 2001 From: Marton Kiss Date: Thu, 27 Mar 2014 17:24:50 +0100 Subject: [PATCH] Openstackid site-update feature Update openstackid site into a new slot when a new release available on tarballs.openstackid/openstackid site. Change-Id: I59580f5a9d7b4ef09daea4c981977327d29804ff --- modules/openstackid/files/functions | 4 ++++ modules/openstackid/manifests/init.pp | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/openstackid/files/functions b/modules/openstackid/files/functions index 4a5b22a3a2..a185d783ef 100644 --- a/modules/openstackid/files/functions +++ b/modules/openstackid/files/functions @@ -140,6 +140,10 @@ function site_update() { target_dir="$SITE_ROOT/$TARGET_SLOT" rm -rf $target_dir mkdir $target_dir + # fetch catalog and write actual version + fetch_catalog + RELEASE_VERSION=`catalog_get_version` + echo $RELEASE_VERSION > $target_dir/release # fetch and extract release tarball umask 0027 if [[ $SOURCE_TARBALL == http* ]]; then diff --git a/modules/openstackid/manifests/init.pp b/modules/openstackid/manifests/init.pp index bc623dd03d..20ad686361 100644 --- a/modules/openstackid/manifests/init.pp +++ b/modules/openstackid/manifests/init.pp @@ -214,4 +214,19 @@ class openstackid ( Package[$php5_packages] ], } -} + exec { 'update-site': + path => '/usr/bin:/bin:/usr/local/bin', + command => '/opt/deploy/deploy.sh update openstackid', + onlyif => '/opt/deploy/deploy.sh status openstackid | grep UPDATE', + logoutput => on_failure, + require => [ + File['/opt/deploy/conf.d/openstackid.conf'], + Apache::Vhost[$vhost_name], + File['/etc/openstackid/recaptcha.php'], + File['/etc/openstackid/database.php'], + File['/etc/openstackid/log.php'], + File['/etc/openstackid/environment.php'], + Package[$php5_packages] ], + } + +} \ No newline at end of file