|
10 | 10 | $manage_server = $puppetdb::params::manage_dbserver, |
11 | 11 | $manage_package_repo = $puppetdb::params::manage_pg_repo, |
12 | 12 | $postgres_version = $puppetdb::params::postgres_version, |
| 13 | + $postgresql_ssl_on = $puppetdb::params::postgresql_ssl_on, |
| 14 | + $postgresql_ssl_key_path = $puppetdb::params::postgresql_ssl_key_path, |
| 15 | + $postgresql_ssl_cert_path = $puppetdb::params::postgresql_ssl_cert_path, |
| 16 | + $postgresql_ssl_ca_cert_path = $puppetdb::params::postgresql_ssl_ca_cert_path |
13 | 17 | ) inherits puppetdb::params { |
14 | 18 |
|
15 | 19 | if $manage_server { |
|
24 | 28 | port => scanf($database_port, '%i')[0], |
25 | 29 | } |
26 | 30 |
|
| 31 | + # configure PostgreSQL communication with Puppet Agent SSL certificates if |
| 32 | + # postgresql_ssl_on is set to true |
| 33 | + if $postgresql_ssl_on { |
| 34 | + postgresql::server::config_entry {'ssl': |
| 35 | + ensure => present, |
| 36 | + value => 'on', |
| 37 | + } |
| 38 | + |
| 39 | + postgresql::server::config_entry {'ssl_key_file': |
| 40 | + ensure => present, |
| 41 | + value => $postgresql_ssl_key_path, |
| 42 | + } |
| 43 | + |
| 44 | + postgresql::server::config_entry {'ssl_cert_file': |
| 45 | + ensure => present, |
| 46 | + value => $postgresql_ssl_cert_path, |
| 47 | + } |
| 48 | + |
| 49 | + postgresql::server::config_entry {'ssl_ca_file': |
| 50 | + ensure => present, |
| 51 | + value => $postgresql_ssl_ca_cert_path, |
| 52 | + } |
| 53 | + } |
| 54 | + |
27 | 55 | # Only install pg_trgm extension, if database it is actually managed by the module |
28 | 56 | if $manage_database { |
29 | 57 |
|
|
0 commit comments