Fix groups-dev portal update sync issue

Groups-dev portal failed to download the release updates from
tarball.openstack.org/groups site, meanwhile the drush dsd-status tool
reported an update available status. This patch resolves this issue
and site-deploy and site-update executed when the .md5 file downloaded
from tarball site updated. The wget --timestamping options is used
to download the .md5 file in case of remote update only.

Change-Id: Iab237567e45864835274c01c8e93363c7ea8b620
Closes-Bug: #1334707
This commit is contained in:
Marton Kiss 2014-06-26 16:55:46 +02:00
parent 9adc5fd79b
commit 605407744f
1 changed files with 33 additions and 19 deletions

View File

@ -188,27 +188,38 @@ class drupal (
# add site distro tarball from http repository including
# md5 hash file
exec { "download:${package_branch}.tar.gz":
command => "/usr/bin/wget ${package_repository}/${package_branch}.tar.gz -O /srv/downloads/${package_branch}.tar.gz",
creates => "/srv/downloads/${package_branch}.tar.gz",
exec { "download:${package_branch}.md5":
command => "/usr/bin/wget --timestamping ${package_repository}/${package_branch}.md5 -O /tmp/${package_branch}.md5",
logoutput => 'on_failure',
require => File['/srv/downloads'],
cwd => '/tmp'
}
exec { "download:${package_branch}.md5":
command => "/usr/bin/wget ${package_repository}/${package_branch}.md5 -O /srv/downloads/${package_branch}.md5",
creates => "/srv/downloads/${package_branch}.md5",
logoutput => 'on_failure',
require => [ Exec["download:${package_branch}.tar.gz"] ],
file { "/srv/downloads/${package_branch}.md5":
ensure => present,
source => "/tmp/${package_branch}.md5",
owner => 'root',
group => 'root',
mode => '0644',
require => [ Exec["download:${package_branch}.md5"], File['/srv/downloads'] ]
}
exec { "download:${package_branch}.tar.gz":
command => "/usr/bin/wget ${package_repository}/${package_branch}.tar.gz -O /srv/downloads/${package_branch}.tar.gz",
logoutput => 'on_failure',
refreshonly => true,
subscribe => File["/srv/downloads/${package_branch}.md5"],
require => File['/srv/downloads'],
}
# deploy a site from scratch when site status is 'NOT INSTALLED'
exec { "sitedeploy-${site_name}":
command => "/usr/bin/drush dsd-init @${site_alias} /srv/downloads/${package_branch}.tar.gz",
logoutput => true,
timeout => 600,
onlyif => "/usr/bin/drush dsd-status @${site_alias} | /bin/grep -c 'NOT INSTALLED'",
require => [
command => "/usr/bin/drush dsd-init @${site_alias} /srv/downloads/${package_branch}.tar.gz",
logoutput => true,
timeout => 600,
onlyif => "/usr/bin/drush dsd-status @${site_alias} | /bin/grep -c 'NOT INSTALLED'",
refreshonly => true,
subscribe => File["/srv/downloads/${package_branch}.md5"],
require => [
Exec["download:${package_branch}.md5"],
File['/etc/drush/aliases.drushrc.php'],
]
@ -216,13 +227,16 @@ class drupal (
# update the site into a new slot when a remote update available
exec { "siteupdate-${site_name}":
command => "/usr/bin/drush dsd-update @${site_alias} /srv/downloads/${package_branch}.tar.gz",
logoutput => true,
timeout => 600,
onlyif => "/usr/bin/drush dsd-status @${site_alias} | /bin/grep -c 'UPDATE'",
require => [
command => "/usr/bin/drush dsd-update @${site_alias} /srv/downloads/${package_branch}.tar.gz",
logoutput => true,
timeout => 600,
onlyif => "/usr/bin/drush dsd-status @${site_alias} | /bin/grep -c 'UPDATE'",
refreshonly => true,
subscribe => File["/srv/downloads/${package_branch}.md5"],
require => [
Exec["download:${package_branch}.md5"],
File['/etc/drush/aliases.drushrc.php'],
Exec["sitedeploy-${site_name}"],
]
}