system-config/modules/openstack_project/manifests/puppetdb.pp
Colleen Murphy 1bd9635d97 Use openstack_project::server class where possible
As we move configuration for zuul worker nodes out of puppet and into
DIB elements, we should keep track of what is being managed by puppet
for long-lived servers and what no longer needs to be managed for single
use workers. The openstack_project::server class wraps the
openstack_server::template class which stores configuration that is
common to both types of machines. This patch updates the backup_server
and lists class to use the openstack_project::server class, updating
class parameters where they differ between o_p:server and o_p::template.
This way we can chop down the template class and move bits into the
server class until eventually we can entirely remove the
openstack_project::single_use_slave and openstack_project::template
classes.

Change-Id: Ief997d608a3a1632ec34da34ec46a237ead761f5
2017-04-07 21:56:17 +02:00

62 lines
1.6 KiB
Puppet

# == Class: openstack_project::puppetdb
#
class openstack_project::puppetdb (
$puppetboard = true,
$version = '2.3.8-1puppetlabs1',
) {
# The puppetlabs postgres module does not manage the postgres user
# and group for us. Create them here to ensure concat can create
# dirs and files owned by this user and group.
user { 'postgres':
ensure => present,
gid => 'postgres',
system => true,
require => Group['postgres'],
}
group { 'postgres':
ensure => present,
system => true,
}
class { 'puppetdb::database::postgresql':
require => [User['postgres'],
Class['openstack_project::server'],],
}
class { '::puppetdb::server':
database_host => 'localhost',
ssl_listen_address => '0.0.0.0', # works for ipv6 too
java_args => { '-Xmx' => '512m', '-Xms' => '256m' },
puppetdb_version => $version,
require => [ User['postgres'],
Class['puppetdb::database::postgresql'],],
}
if $puppetboard {
class { 'openstack_project::puppetboard': }
}
if versioncmp($version, '2.3.8') > 0 {
file { '/etc/puppetdb/':
ensure => directory,
before => Class['::puppetdb::server'],
}
file { '/etc/puppetdb/conf.d/':
ensure => directory,
before => Class['::puppetdb::server'],
}
apt::source { 'puppetlabs-pc1':
location => 'http://apt.puppetlabs.com',
repos => 'PC1',
key => {
'id' =>'47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
'server' => 'pgp.mit.edu',
},
before => Class['::puppetdb::server'],
}
}
}