7d003b8f68
Add a new update_pkg_list_cmd parameter to the openstack_project module so we can control what each distribution runs to update package lists. On Ubuntu we want to run 'apt-get update' and on RHEL we want to run nothing since yum does this automatically. Change-Id: Iab08930bac5f992711b05bcbfa23b7daab12a060 Reviewed-on: https://review.openstack.org/23571 Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Approved: Jeremy Stanley <fungi@yuggoth.org> Tested-by: Jenkins
30 lines
781 B
Puppet
30 lines
781 B
Puppet
# == Class: openstack_project::puppet_cron
|
|
#
|
|
class openstack_project::puppet_cron($ensure = present)
|
|
{
|
|
include logrotate
|
|
|
|
class { 'puppetboot':
|
|
ensure => $ensure,
|
|
}
|
|
cron { 'updatepuppet':
|
|
ensure => $ensure,
|
|
user => 'root',
|
|
minute => '*/15',
|
|
command => "${::openstack_project::params::update_pkg_list_cmd}sleep $((RANDOM\%600)) && puppet agent --test >>/var/log/manifest.log",
|
|
environment => 'PATH=/var/lib/gems/1.8/bin:/usr/bin:/bin:/usr/sbin:/sbin',
|
|
}
|
|
logrotate::file { 'updatepuppet':
|
|
ensure => $ensure,
|
|
log => '/var/log/manifest.log',
|
|
options => ['compress',
|
|
'delaycompress',
|
|
'missingok',
|
|
'rotate 7',
|
|
'daily',
|
|
'notifempty',
|
|
],
|
|
require => Cron['updatepuppet'],
|
|
}
|
|
}
|