feat: moved puppetdb profiles
- move puppetdb profiles to profiles::puppetdb namespace - add profile to manage puppetdb api ssl certificates
This commit is contained in:
@@ -1,45 +0,0 @@
|
||||
# configure the puppetdb api service
|
||||
class profiles::puppet::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,
|
||||
}
|
||||
|
||||
# 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',
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
# configure the puppetdb sql service
|
||||
class profiles::puppet::puppetdb_sql (
|
||||
String $puppetdb_host = lookup('puppetdbsql'),
|
||||
String $listen_address = $facts['networking']['ip'],
|
||||
) {
|
||||
|
||||
# disable the postgresql dnf module for el8+
|
||||
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] >= '8' {
|
||||
# based on https://github.com/puppetlabs/puppetlabs-postgresql/blob/main/manifests/dnfmodule.pp
|
||||
package { 'postgresql dnf module':
|
||||
ensure => 'disabled',
|
||||
name => 'postgresql',
|
||||
provider => 'dnfmodule',
|
||||
before => Class['puppetdb::database::postgresql'],
|
||||
}
|
||||
}
|
||||
|
||||
# Install and configure PostgreSQL for PuppetDB
|
||||
class { 'puppetdb::database::postgresql':
|
||||
listen_addresses => $listen_address,
|
||||
postgres_version => '15',
|
||||
puppetdb_server => $puppetdb_host,
|
||||
}
|
||||
|
||||
contain ::puppetdb::database::postgresql
|
||||
|
||||
# create the postgresql::server::config_entry resources
|
||||
$pg_config_entries = lookup('postgresql_config_entries', Hash[String, Data], 'hash', {})
|
||||
$pg_config_entries.each |String $key, Data $value| {
|
||||
postgresql::server::config_entry { $key:
|
||||
ensure => 'present',
|
||||
value => $value,
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user