- changed to use puppetdbapi and puppetdbsql hiera keys - updated all classes that referenced old values
36 lines
1.2 KiB
Puppet
36 lines
1.2 KiB
Puppet
# 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,
|
|
}
|
|
}
|
|
}
|