diff --git a/hieradata/common.yaml b/hieradata/common.yaml index dcc73a2..096a830 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -96,6 +96,9 @@ lookup_options: profiles::base::hosts::additional_hosts: merge: strategy: deep + postgresql_config_entries: + merge: + strategy: deep facts_path: '/opt/puppetlabs/facter/facts.d' diff --git a/hieradata/roles/infra/puppetdb/sql.yaml b/hieradata/roles/infra/puppetdb/sql.yaml new file mode 100644 index 0000000..0d6409a --- /dev/null +++ b/hieradata/roles/infra/puppetdb/sql.yaml @@ -0,0 +1,4 @@ +--- +postgresql_config_entries: + max_connections: 300 + shared_buffers: '256MB' diff --git a/site/profiles/manifests/puppet/puppetdb_sql.pp b/site/profiles/manifests/puppet/puppetdb_sql.pp index 2d80d30..5afa9a5 100644 --- a/site/profiles/manifests/puppet/puppetdb_sql.pp +++ b/site/profiles/manifests/puppet/puppetdb_sql.pp @@ -24,4 +24,12 @@ class profiles::puppet::puppetdb_sql ( 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, + } + } }