2025-12-04 19:49:59 +01:00
|
|
|
## confdroid_postgresql::server::pg_hba.pp
|
|
|
|
|
# Module name: confdroid_postgresql
|
2025-12-05 14:22:43 +01:00
|
|
|
# Author: 12ww1160 (arne_teuke@puppetsoft.com)
|
2025-09-28 15:47:55 +02:00
|
|
|
# @summary Class manages pg_hba.conf file and line entries through define
|
|
|
|
|
# pg_hba_rule.pp
|
2025-12-04 19:49:59 +01:00
|
|
|
# @example confdroid_postgresql::server::pghba::pg_hba_rule { 'local access for role postgres':
|
2025-10-01 15:56:49 +02:00
|
|
|
# pl_auth_type => 'local',
|
|
|
|
|
# pl_auth_database => 'all',
|
|
|
|
|
# pl_auth_user => 'postgres',
|
|
|
|
|
# pl_auth_method => 'trust',
|
|
|
|
|
# pl_auth_order => '001',
|
|
|
|
|
# pl_auth_option => '',
|
2025-09-28 15:47:55 +02:00
|
|
|
# }
|
|
|
|
|
##############################################################################
|
2025-12-04 19:49:59 +01:00
|
|
|
class confdroid_postgresql::server::pghba::pg_hba (
|
2025-09-28 15:47:55 +02:00
|
|
|
|
2025-12-04 19:49:59 +01:00
|
|
|
) inherits confdroid_postgresql::params {
|
2025-09-28 15:47:55 +02:00
|
|
|
if $fqdn == $pl_server_fqdn {
|
|
|
|
|
# create the pg_hba.conf file
|
|
|
|
|
|
|
|
|
|
concat { $pl_pg_hba_conf:
|
|
|
|
|
ensure => present,
|
|
|
|
|
owner => 'postgres',
|
2025-10-01 18:31:18 +02:00
|
|
|
mode => '0600',
|
2025-09-28 15:47:55 +02:00
|
|
|
notify => Service[$pl_service],
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# manage file header
|
|
|
|
|
|
2025-12-05 14:28:25 +01:00
|
|
|
concat::fragment { 'pghba_header':
|
2025-09-28 15:47:55 +02:00
|
|
|
target => $pl_pg_hba_conf,
|
|
|
|
|
content => template($pl_pg_hba_conf_erb),
|
|
|
|
|
order => '000',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# manage default rules => should go into external config set
|
2025-12-04 19:49:59 +01:00
|
|
|
# confdroid_postgresql::server::pghba::pg_hba_rule { 'local access for role postgres':
|
2025-10-01 15:56:49 +02:00
|
|
|
# pl_auth_type => 'local',
|
|
|
|
|
# pl_auth_database => 'all',
|
|
|
|
|
# pl_auth_user => $ql_user_name,
|
|
|
|
|
# pl_auth_method => 'trust',
|
|
|
|
|
# pl_auth_order => '001',
|
|
|
|
|
# pl_auth_option => $ql_auth_option,
|
2025-09-28 15:47:55 +02:00
|
|
|
# }
|
|
|
|
|
|
2025-12-04 19:49:59 +01:00
|
|
|
# confdroid_postgresql::server::pghba::pg_hba_rule { 'local access for all roles':
|
2025-10-01 15:56:49 +02:00
|
|
|
# pl_auth_type => 'local',
|
|
|
|
|
# pl_auth_database => 'all',
|
|
|
|
|
# pl_auth_user => 'all',
|
|
|
|
|
# pl_auth_method => 'trust',
|
|
|
|
|
# pl_auth_order => '002',
|
|
|
|
|
# pl_auth_option => $pl_auth_option,
|
2025-09-28 15:47:55 +02:00
|
|
|
# }
|
|
|
|
|
}
|
|
|
|
|
}
|