]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blob - modules/profile/manifests/postgresql.pp
Refactor cryptoportfolio postgresql
[perso/Immae/Projets/Puppet.git] / modules / profile / manifests / postgresql.pp
1 class profile::postgresql (
2 Optional[String] $pg_user = "postgres",
3 Optional[String] $pg_group = "postgres",
4 ) {
5 $password_seed = lookup("base_installation::puppet_pass_seed")
6
7 class { '::postgresql::globals':
8 encoding => 'UTF-8',
9 locale => 'en_US.UTF-8',
10 pg_hba_conf_defaults => false,
11 }
12
13 class { '::postgresql::client': }
14
15 # FIXME: postgresql module is buggy and doesn't create dir?
16 file { "/var/lib/postgres":
17 ensure => directory,
18 owner => $pg_user,
19 group => $pg_group,
20 before => File["/var/lib/postgres/data"],
21 require => Package["postgresql-server"],
22 }
23
24 class { '::postgresql::server':
25 postgres_password => generate_password(24, $password_seed, "postgres"),
26 listen_addresses => "*",
27 }
28
29 profile::postgresql::base_pg_hba_rules { "default": }
30
31 }
32