]> git.immae.eu Git - perso/Immae/Projets/Puppet.git/blame - modules/role/manifests/cryptoportfolio.pp
Add localhost access for postgres
[perso/Immae/Projets/Puppet.git] / modules / role / manifests / cryptoportfolio.pp
CommitLineData
57ae81ea
IB
1class role::cryptoportfolio {
2 include "base_installation"
3
4 include "profile::postgresql"
5
6 $password_seed = lookup("base_installation::puppet_pass_seed") |$key| { {} }
7
8 postgresql::server::db { 'cryptoportfolio':
9 user => 'cryptoportfolio',
10 password => postgresql_password('cryptoportfolio', generate_password(24, $password_seed, "postgres_cryptoportfolio")),
11 }
12
6a919776
IB
13 postgresql::server::pg_hba_rule { 'allow localhost TCP access to cryptoportfolio user':
14 type => 'host',
15 database => 'cryptoportfolio',
16 user => 'cryptoportfolio',
17 address => '127.0.0.1/32',
18 auth_method => 'md5',
19 order => "b0",
20 }
21 postgresql::server::pg_hba_rule { 'allow localhost ip6 TCP access to cryptoportfolio user':
22 type => 'host',
23 database => 'cryptoportfolio',
24 user => 'cryptoportfolio',
25 address => '::1/128',
26 auth_method => 'md5',
27 order => "b0",
28 }
57ae81ea
IB
29 ensure_packages("go")
30}