Cleanup pypimirror init.pp manifest lint errors.
Change-Id: I052c1cc1f4633c11b5b89390ffd9f728e99db088 Reviewed-on: https://review.openstack.org/14394 Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com> 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
This commit is contained in:
parent
4392f8d020
commit
e3b4d7b9e5
@ -1,10 +1,11 @@
|
|||||||
class pypimirror ( $vhost_name = $fqdn,
|
class pypimirror(
|
||||||
$log_filename = "/var/log/pypimirror.log",
|
$vhost_name = $::fqdn,
|
||||||
$mirror_file_path = "/var/lib/pypimirror",
|
$log_filename = '/var/log/pypimirror.log',
|
||||||
$pip_download = "/var/lib/pip-download",
|
$mirror_file_path = '/var/lib/pypimirror',
|
||||||
$pip_cache = "/var/cache/pip",
|
$pip_download = '/var/lib/pip-download',
|
||||||
$git_source = "https://github.com",
|
$pip_cache = '/var/cache/pip',
|
||||||
$projects = [] )
|
$git_source = 'https://github.com',
|
||||||
|
$projects = [] )
|
||||||
{
|
{
|
||||||
|
|
||||||
include apache
|
include apache
|
||||||
@ -16,103 +17,104 @@ class pypimirror ( $vhost_name = $fqdn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
package { 'pip':
|
package { 'pip':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
provider => 'pip',
|
provider => 'pip',
|
||||||
require => Class[pip]
|
require => Class[pip]
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/usr/local/mirror_scripts':
|
file { '/usr/local/mirror_scripts':
|
||||||
ensure => 'directory',
|
ensure => directory,
|
||||||
mode => 755,
|
mode => '0755',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
}
|
}
|
||||||
|
|
||||||
file { $pip_download:
|
file { $pip_download:
|
||||||
ensure => 'directory',
|
ensure => directory,
|
||||||
mode => 755,
|
mode => '0755',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
}
|
}
|
||||||
|
|
||||||
file { $pip_cache:
|
file { $pip_cache:
|
||||||
ensure => 'directory',
|
ensure => directory,
|
||||||
mode => 755,
|
mode => '0755',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/openstackci':
|
file { '/etc/openstackci':
|
||||||
ensure => "directory",
|
ensure => directory,
|
||||||
owner => "root",
|
owner => 'root',
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/openstackci/projects.yaml':
|
file { '/etc/openstackci/projects.yaml':
|
||||||
owner => 'root',
|
ensure => present,
|
||||||
group => 'root',
|
owner => 'root',
|
||||||
mode => 444,
|
group => 'root',
|
||||||
ensure => 'present',
|
mode => '0444',
|
||||||
source => 'puppet:///openstack_project/review.projects.yaml',
|
source => 'puppet:///openstack_project/review.projects.yaml',
|
||||||
replace => true,
|
replace => true,
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/usr/local/mirror_scripts/run-mirror.sh':
|
file { '/usr/local/mirror_scripts/run-mirror.sh':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => 755,
|
mode => '0755',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
content => template('pypimirror/run-mirror.sh.erb'),
|
content => template('pypimirror/run-mirror.sh.erb'),
|
||||||
require => File['/usr/local/mirror_scripts'],
|
require => File['/usr/local/mirror_scripts'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/usr/local/mirror_scripts/run_mirror.py':
|
file { '/usr/local/mirror_scripts/run_mirror.py':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => 755,
|
mode => '0755',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
source => "puppet:///modules/pypimirror/run_mirror.py",
|
source => 'puppet:///modules/pypimirror/run_mirror.py',
|
||||||
require => File['/usr/local/mirror_scripts'],
|
require => File['/usr/local/mirror_scripts'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/usr/local/mirror_scripts/pull-repo.sh':
|
file { '/usr/local/mirror_scripts/pull-repo.sh':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => 755,
|
mode => '0755',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
source => "puppet:///modules/pypimirror/pull-repo.sh",
|
source => 'puppet:///modules/pypimirror/pull-repo.sh',
|
||||||
require => File['/usr/local/mirror_scripts'],
|
require => File['/usr/local/mirror_scripts'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/usr/local/mirror_scripts/process_cache.py':
|
file { '/usr/local/mirror_scripts/process_cache.py':
|
||||||
ensure => present,
|
ensure => present,
|
||||||
mode => 755,
|
mode => '0755',
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'root',
|
group => 'root',
|
||||||
source => "puppet:///modules/pypimirror/process_cache.py",
|
source => 'puppet:///modules/pypimirror/process_cache.py',
|
||||||
require => File['/usr/local/mirror_scripts'],
|
require => File['/usr/local/mirror_scripts'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add cron job to update the mirror
|
# Add cron job to update the mirror
|
||||||
|
|
||||||
cron { "update_mirror":
|
cron { 'update_mirror':
|
||||||
user => root,
|
user => 'root',
|
||||||
minute => "0",
|
minute => '0',
|
||||||
command => '/usr/local/mirror_scripts/run-mirror.sh',
|
command => '/usr/local/mirror_scripts/run-mirror.sh',
|
||||||
require => File["/usr/local/mirror_scripts/run-mirror.sh"],
|
require => File['/usr/local/mirror_scripts/run-mirror.sh'],
|
||||||
}
|
}
|
||||||
|
|
||||||
# Rotate the mirror log file
|
# Rotate the mirror log file
|
||||||
|
|
||||||
include logrotate
|
include logrotate
|
||||||
logrotate::file {"pypimirror":
|
logrotate::file { 'pypimirror':
|
||||||
log => $log_filename,
|
log => $log_filename,
|
||||||
options => ["compress", "delaycompress", "missingok", "rotate 7", "daily", "notifempty"],
|
options => ['compress', 'delaycompress', 'missingok', 'rotate 7',
|
||||||
require => Cron["update_mirror"],
|
'daily', 'notifempty'],
|
||||||
|
require => Cron['update_mirror'],
|
||||||
}
|
}
|
||||||
|
|
||||||
apache::vhost { $vhost_name:
|
apache::vhost { $vhost_name:
|
||||||
port => 80,
|
port => 80,
|
||||||
docroot => $mirror_file_path,
|
docroot => $mirror_file_path,
|
||||||
priority => 50,
|
priority => 50,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user