system-config/modules/openstack_project/manifests/gem_mirror.pp
Emilien Macchi 8829fc8a69 Added Gem Mirror to Infra
This patch adds a static, read-only gem mirror to openstack-infra's regional
mirrors under the /gem path.

Change-Id: I2f67fe01d32c4472ff56862b9dc25b9915a695c0
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-12-13 20:16:19 -05:00

66 lines
1.4 KiB
Puppet

# == Class: openstack_project::gem_mirror
#
class openstack_project::gem_mirror (
$data_directory = '/afs/.openstack.org/mirror/gem',
$parallelism = '10',
$cron_frequency = '*/5',
) {
include ::logrotate
logrotate::file { 'rubygems-mirror':
log => '/var/log/rubygems/mirror.log',
options => [
'compress',
'copytruncate',
'missingok',
'rotate 7',
'daily',
'notifempty',
],
}
group { 'rubygems':
ensure => 'present',
before => User['rubygems'],
}
user { 'rubygems':
ensure => 'present',
comment => 'Service used to run rubygems mirror synchronization',
managehome => true,
require => Package['rubygems-mirror'],
}
file { '/home/rubygems/.gem':
ensure => directory,
owner => 'rubygems',
group => 'rubygems',
mode => '0600',
replace => true,
require => User['rubygems'],
}
file { '/home/rubygems/.gem/.mirrorrc':
ensure => present,
owner => 'rubygems',
group => 'rubygems',
mode => '0600',
content => template('openstack_project/rubygems_mirrorrc.erb'),
replace => true,
require => File['/home/rubygems/.gem'],
}
package { 'rubygems-mirror':
ensure => latest,
provider => gem,
}
file { ['/var/run/rubygems','/var/log/rubygems']:
ensure => directory,
owner => 'rubygems',
group => 'rubygems',
require => User['rubygems'],
}
}