2014-02-15 22:54:03 +00:00
|
|
|
# == Class: openstack_project::puppetdb
|
|
|
|
#
|
|
|
|
class openstack_project::puppetdb (
|
2014-03-04 16:14:35 +00:00
|
|
|
$puppetboard = true,
|
2016-02-25 18:50:16 +00:00
|
|
|
$version = '2.3.8-1puppetlabs1',
|
2014-02-15 22:54:03 +00:00
|
|
|
) {
|
|
|
|
|
|
|
|
# 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,
|
|
|
|
}
|
|
|
|
|
2015-04-13 10:25:54 +00:00
|
|
|
class { 'puppetdb::database::postgresql':
|
2014-02-24 18:20:18 +00:00
|
|
|
require => [User['postgres'],
|
2015-03-10 01:49:13 +00:00
|
|
|
Class['openstack_project::template'],],
|
2014-02-15 22:54:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class { '::puppetdb::server':
|
2014-02-24 18:20:18 +00:00
|
|
|
database_host => 'localhost',
|
|
|
|
ssl_listen_address => '0.0.0.0', # works for ipv6 too
|
2016-01-27 00:32:31 +00:00
|
|
|
java_args => { '-Xmx' => '512m', '-Xms' => '256m' },
|
2016-02-25 18:50:16 +00:00
|
|
|
puppetdb_version => $version,
|
2014-02-24 18:20:18 +00:00
|
|
|
require => [ User['postgres'],
|
|
|
|
Class['puppetdb::database::postgresql'],],
|
2014-02-15 22:54:03 +00:00
|
|
|
}
|
|
|
|
|
2014-03-04 16:14:35 +00:00
|
|
|
if $puppetboard {
|
|
|
|
class { 'openstack_project::puppetboard': }
|
|
|
|
}
|
|
|
|
|
2016-02-25 18:50:16 +00:00
|
|
|
if versioncmp($version, '2.3.8') > 0 {
|
2016-05-01 19:59:41 +00:00
|
|
|
file { '/etc/puppetdb/':
|
|
|
|
ensure => directory,
|
|
|
|
before => Class['::puppetdb::server'],
|
|
|
|
}
|
|
|
|
file { '/etc/puppetdb/conf.d/':
|
|
|
|
ensure => directory,
|
|
|
|
before => Class['::puppetdb::server'],
|
|
|
|
}
|
2016-02-25 18:50:16 +00:00
|
|
|
apt::source { 'puppetlabs-pc1':
|
|
|
|
location => 'http://apt.puppetlabs.com',
|
|
|
|
repos => 'PC1',
|
|
|
|
key => {
|
|
|
|
'id' =>'47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30',
|
|
|
|
'server' => 'pgp.mit.edu',
|
|
|
|
},
|
|
|
|
before => Class['::puppetdb::server'],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-02-15 22:54:03 +00:00
|
|
|
}
|