e71377718e
This will set the apache service to bounce, which will in turn bounce the puppetmaster, when puppetdb needs to notify the service to rehash its config. Change-Id: I2033b42ba246619172f39e09e98d20d702d0156a
73 lines
1.9 KiB
Puppet
73 lines
1.9 KiB
Puppet
# == Class: openstack_project::puppetmaster
|
|
#
|
|
class openstack_project::puppetmaster (
|
|
$sysadmins = []
|
|
) {
|
|
class { 'openstack_project::server':
|
|
iptables_public_tcp_ports => [4505, 4506, 8140],
|
|
sysadmins => $sysadmins,
|
|
}
|
|
|
|
class { 'salt':
|
|
salt_master => 'ci-puppetmaster.openstack.org',
|
|
}
|
|
class { 'salt::master': }
|
|
|
|
cron { 'updatepuppetmaster':
|
|
user => 'root',
|
|
minute => '*/15',
|
|
command => 'sleep $((RANDOM\%600)) && cd /opt/config/production && git fetch -q && git reset -q --hard @{u} && ./install_modules.sh && touch manifests/site.pp',
|
|
environment => 'PATH=/var/lib/gems/1.8/bin:/usr/bin:/bin:/usr/sbin:/sbin',
|
|
}
|
|
|
|
cron { 'deleteoldreports':
|
|
user => 'root',
|
|
hour => '3',
|
|
minute => '0',
|
|
command => 'sleep $((RANDOM\%600)) && find /var/lib/puppet/reports -name \'*.yaml\' -mtime +7 -execdir rm {} \;',
|
|
environment => 'PATH=/var/lib/gems/1.8/bin:/usr/bin:/bin:/usr/sbin:/sbin',
|
|
}
|
|
|
|
file { '/etc/puppet/hiera.yaml':
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'root',
|
|
mode => '0555',
|
|
source => 'puppet:///modules/openstack_project/puppetmaster/hiera.yaml',
|
|
replace => true,
|
|
require => Class['openstack_project::server'],
|
|
}
|
|
|
|
file { '/var/lib/puppet/reports':
|
|
ensure => directory,
|
|
owner => 'puppet',
|
|
group => 'puppet',
|
|
mode => '0750',
|
|
}
|
|
|
|
# Cloud credentials are stored in this directory for launch-node.py.
|
|
file { '/root/ci-launch':
|
|
ensure => directory,
|
|
owner => 'root',
|
|
group => 'admin',
|
|
mode => '0750',
|
|
}
|
|
|
|
# For launch/launch-node.py.
|
|
package { ['python-cinderclient', 'python-novaclient']:
|
|
ensure => latest,
|
|
provider => pip,
|
|
}
|
|
package { 'python-paramiko':
|
|
ensure => present,
|
|
}
|
|
|
|
# Enable puppetdb
|
|
|
|
class { 'puppetdb::master::config':
|
|
puppetdb_server => 'puppetdb.openstack.org',
|
|
puppet_service_name => 'apache2',
|
|
}
|
|
|
|
}
|