- move puppetdb profiles to profiles::puppetdb namespace - add profile to manage puppetdb api ssl certificates
48 lines
1.3 KiB
Puppet
48 lines
1.3 KiB
Puppet
# configure the puppetdb api service
|
|
class profiles::puppetdb::puppetdb_api (
|
|
String $postgres_host = lookup('puppetdbsql'),
|
|
String $listen_address = $facts['networking']['ip'],
|
|
Stdlib::Absolutepath $java_bin = '/usr/bin/java',
|
|
Hash $java_args = {},
|
|
) {
|
|
|
|
# wait for enc_role to match the required role
|
|
if $facts['enc_role'] == 'roles::infra::puppetdb::api' {
|
|
class { 'java':
|
|
package => 'java-11-openjdk-devel',
|
|
before => Class['puppetdb::server'],
|
|
}
|
|
|
|
class { 'puppetdb::server':
|
|
database_host => $postgres_host,
|
|
manage_firewall => false,
|
|
ssl_listen_address => $listen_address,
|
|
listen_address => $listen_address,
|
|
java_bin => $java_bin,
|
|
java_args => $java_args,
|
|
}
|
|
|
|
contain ::puppetdb::server
|
|
|
|
class { 'prometheus::puppetdb_exporter':
|
|
puppetdb_url => "http://${listen_address}:8080/pdb/query",
|
|
export_scrape_job => true,
|
|
}
|
|
|
|
include profiles::puppetdb::ssl
|
|
|
|
# export haproxy balancemember
|
|
profiles::haproxy::balancemember { "${facts['networking']['fqdn']}_8080":
|
|
service => 'be_puppetdbapi',
|
|
ports => [8080],
|
|
options => [
|
|
"cookie ${facts['networking']['hostname']}",
|
|
'check',
|
|
'inter 2s',
|
|
'rise 3',
|
|
'fall 2',
|
|
]
|
|
}
|
|
}
|
|
}
|