system-config/modules/openstack_project/manifests/afsrelease.pp
James E. Blair 3fc724a675 Add a cron job to release AFS volumes
Every 5 minutes, check to see if the docs volumes have been updated,
and if so, release them.  This means we can serve the docs volumes
from replicated read-only volumes with only a 5 minute delay.

Since this does not coordinate with the docs publishing jobs, we
may end up releasing partial updates, however, those jobs, since they
use rsync, should tolerate this.

Change-Id: I082ae6f37af9a6e12ad62b0cc4cb45e631a0935b
2016-12-19 18:53:26 +01:00

45 lines
1.0 KiB
Puppet

# Release afs volumes
class openstack_project::afsrelease (
) {
include logrotate
file { '/usr/local/bin/release-volumes':
ensure => present,
owner => 'root',
group => 'root',
mode => '0755',
source => 'puppet:///modules/openstack_project/openafs/release-volumes.py',
}
file { '/var/log/release':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
}
cron { 'release':
user => 'root',
minute => '*/5',
command => '/usr/local/bin/release-volumes >>/var/log/release/release.log 2>&1',
environment => 'PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin',
require => [
File['/usr/local/bin/release-volumes'],
]
}
logrotate::file { 'release':
ensure => present,
log => '/var/log/release/release.log',
options => ['compress',
'copytruncate',
'delaycompress',
'missingok',
'rotate 7',
'daily',
'notifempty',
],
require => Cron['release'],
}
}