1 class profile::postgresql {
2 $password_seed = lookup("base_installation::puppet_pass_seed") |$key| { {} }
4 class { '::postgresql::globals':
6 locale => 'en_US.UTF-8',
7 pg_hba_conf_defaults => false,
10 # FIXME: get it from the postgresql module?
13 class { '::postgresql::client': }
15 # FIXME: postgresql module is buggy and doesn't create dir?
16 file { "/var/lib/postgres":
20 before => File["/var/lib/postgres/data"],
21 require => Package["postgresql-server"],
24 class { '::postgresql::server':
25 postgres_password => generate_password(24, $password_seed, "postgres")
28 postgresql::server::pg_hba_rule { 'local access as postgres user':
29 description => 'Allow local access to postgres user',
33 auth_method => 'ident',
36 postgresql::server::pg_hba_rule { 'localhost access as postgres user':
37 description => 'Allow localhost access to postgres user',
41 address => "127.0.0.1/32",
45 postgresql::server::pg_hba_rule { 'localhost ip6 access as postgres user':
46 description => 'Allow localhost access to postgres user',
54 postgresql::server::pg_hba_rule { 'deny access to postgresql user':
55 description => 'Deny remote access to postgres user',
59 address => "0.0.0.0/0",
60 auth_method => 'reject',
64 postgresql::server::pg_hba_rule { 'local access':
65 description => 'Allow local access with password',
73 postgresql::server::pg_hba_rule { 'local access with same name':
74 description => 'Allow local access with same name',
78 auth_method => 'ident',