Jeremy Stanley 8e58872966 Correct cron entry for pypimirror.
* modules/pypimirror/manifests/init.pp: An errant change in commit
008fb47 switched pypimirror's update_mirror cron entry from
specifying hour 0 to minute 0 instead. This corrects it back.

Change-Id: Ibedc4e0f823f8bda229da99ed4edc27702118c60
Reviewed-on: https://review.openstack.org/18902
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
2013-01-03 18:43:00 +00:00

116 lines
2.3 KiB
Puppet

# == Class: pypimorror
#
class pypimirror(
$vhost_name = $::fqdn,
$log_filename = '/var/log/pypimirror.log',
$mirror_file_path = '/var/lib/pypimirror',
$pip_download = '/var/lib/pip-download',
$pip_cache = '/var/cache/pip',
$git_source = 'https://github.com',
$local_git_dir = '/var/lib/git',
$ssh_project_key = 'UNDEF',
$projects = []
) {
include apache
include pip
include remove_nginx
include jeepyb
if ! defined(Package['python-yaml']) {
package { 'python-yaml':
ensure => present,
}
}
file { '/usr/local/mirror_scripts':
ensure => directory,
mode => '0755',
owner => 'root',
group => 'root',
}
file { $pip_download:
ensure => directory,
mode => '0755',
owner => 'root',
group => 'root',
}
file { $pip_cache:
ensure => directory,
mode => '0755',
owner => 'root',
group => 'root',
}
file { '/etc/openstackci':
ensure => directory,
owner => 'root',
}
file { '/etc/openstackci/projects.yaml':
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
content => template('openstack_project/review.projects.yaml.erb'),
replace => true,
}
file { '/usr/local/mirror_scripts/run-mirror.sh':
ensure => present,
mode => '0755',
owner => 'root',
group => 'root',
content => template('pypimirror/run-mirror.sh.erb'),
require => [
File['/usr/local/mirror_scripts'],
Class[pip],
],
}
file { '/usr/local/mirror_scripts/run_mirror.py':
ensure => absent,
}
file { '/usr/local/mirror_scripts/pull-repo.sh':
ensure => absent,
}
file { '/usr/local/mirror_scripts/process_cache.py':
ensure => absent,
}
# Add cron job to update the mirror
cron { 'update_mirror':
user => 'root',
hour => '0',
command => '/usr/local/mirror_scripts/run-mirror.sh',
require => File['/usr/local/mirror_scripts/run-mirror.sh'],
}
# Rotate the mirror log file
include logrotate
logrotate::file { 'pypimirror':
log => $log_filename,
options => [
'compress',
'delaycompress',
'missingok',
'rotate 7',
'daily',
'notifempty',
],
require => Cron['update_mirror'],
}
apache::vhost { $vhost_name:
port => 80,
docroot => $mirror_file_path,
priority => 50,
}
}