|
71 | 71 | # PostgreSQL password authentication method, either `md5` or `scram-sha-256` |
72 | 72 | # |
73 | 73 | class puppetdb::database::postgresql ( |
74 | | - $listen_addresses = $puppetdb::params::database_host, |
75 | | - $puppetdb_server = $puppetdb::params::puppetdb_server, |
76 | | - $database_name = $puppetdb::params::database_name, |
77 | | - $database_username = $puppetdb::params::database_username, |
78 | | - Variant[String[1], Sensitive[String[1]]] $database_password = $puppetdb::params::database_password, |
79 | | - $database_port = $puppetdb::params::database_port, |
80 | | - $manage_database = $puppetdb::params::manage_database, |
81 | | - $manage_server = $puppetdb::params::manage_dbserver, |
82 | | - $manage_package_repo = $puppetdb::params::manage_pg_repo, |
83 | | - $postgres_version = $puppetdb::params::postgres_version, |
84 | | - $postgresql_ssl_on = $puppetdb::params::postgresql_ssl_on, |
85 | | - $postgresql_ssl_key_path = $puppetdb::params::postgresql_ssl_key_path, |
86 | | - $postgresql_ssl_cert_path = $puppetdb::params::postgresql_ssl_cert_path, |
87 | | - $postgresql_ssl_ca_cert_path = $puppetdb::params::postgresql_ssl_ca_cert_path, |
88 | | - $read_database_username = $puppetdb::params::read_database_username, |
89 | | - Variant[String[1], Sensitive[String[1]]] $read_database_password = $puppetdb::params::read_database_password, |
90 | | - $read_database_host = $puppetdb::params::read_database_host, |
91 | | - Boolean $password_sensitive = false, |
92 | | - Postgresql::Pg_password_encryption $password_encryption = $puppetdb::params::password_encryption, |
| 74 | + Stdlib::Host $listen_addresses = $puppetdb::params::database_host, |
| 75 | + Stdlib::Host $puppetdb_server = $puppetdb::params::puppetdb_server, |
| 76 | + String[1] $database_name = $puppetdb::params::database_name, |
| 77 | + String[1] $database_username = $puppetdb::params::database_username, |
| 78 | + Variant[String[1], Sensitive[String[1]]] $database_password = $puppetdb::params::database_password, |
| 79 | + Variant[Stdlib::Port::User, Pattern[/\A[0-9]+\Z/]] $database_port = $puppetdb::params::database_port, |
| 80 | + Boolean $manage_database = $puppetdb::params::manage_database, |
| 81 | + Boolean $manage_server = $puppetdb::params::manage_dbserver, |
| 82 | + Boolean $manage_package_repo = $puppetdb::params::manage_pg_repo, |
| 83 | + String[2,3] $postgres_version = $puppetdb::params::postgres_version, |
| 84 | + Boolean $postgresql_ssl_on = $puppetdb::params::postgresql_ssl_on, |
| 85 | + Stdlib::Absolutepath $postgresql_ssl_key_path = $puppetdb::params::postgresql_ssl_key_path, |
| 86 | + Stdlib::Absolutepath $postgresql_ssl_cert_path = $puppetdb::params::postgresql_ssl_cert_path, |
| 87 | + Stdlib::Absolutepath $postgresql_ssl_ca_cert_path = $puppetdb::params::postgresql_ssl_ca_cert_path, |
| 88 | + String[1] $read_database_username = $puppetdb::params::read_database_username, |
| 89 | + Variant[String[1], Sensitive[String[1]]] $read_database_password = $puppetdb::params::read_database_password, |
| 90 | + Optional[Stdlib::Host] $read_database_host = $puppetdb::params::read_database_host, |
| 91 | + Boolean $password_sensitive = false, |
| 92 | + Postgresql::Pg_password_encryption $password_encryption = $puppetdb::params::password_encryption, |
93 | 93 | ) inherits puppetdb::params { |
94 | | - $port = scanf($database_port, '%i')[0] |
| 94 | + $port = case $database_port.is_a(String) { |
| 95 | + true: { scanf($database_port, '%i')[0] } |
| 96 | + default: { $database_port } |
| 97 | + } |
95 | 98 |
|
96 | 99 | if $manage_server { |
97 | 100 | class { 'postgresql::globals': |
|
0 commit comments