diff options
| author | alex <alex@pdp7.net> | 2023-06-18 12:47:04 +0200 |
|---|---|---|
| committer | alex <alex@pdp7.net> | 2023-06-18 12:47:45 +0200 |
| commit | a85e03ef753199a0219a3314e0cff28fc2613a6a (patch) | |
| tree | fb571547f638689bbdd951537200ea83d1038e88 /personal_infra/puppet/modules/postgres | |
| parent | 8226be106d31405c8a9506041d0b1dccaefa41d6 (diff) | |
Allow configuring hba, listen on all addresses
Diffstat (limited to 'personal_infra/puppet/modules/postgres')
| -rw-r--r-- | personal_infra/puppet/modules/postgres/manifests/init.pp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/personal_infra/puppet/modules/postgres/manifests/init.pp b/personal_infra/puppet/modules/postgres/manifests/init.pp index 5213db62..40fd5726 100644 --- a/personal_infra/puppet/modules/postgres/manifests/init.pp +++ b/personal_infra/puppet/modules/postgres/manifests/init.pp @@ -1,4 +1,4 @@ -class postgres { +class postgres($pg_hba_conf) { package {'pgdg-redhat-repo': source => 'https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm', } @@ -9,6 +9,16 @@ class postgres { creates => '/var/lib/pgsql/15/data/PG_VERSION', } -> + [ + file {'/var/lib/pgsql/15/data/pg_hba.conf': + # template at /usr/pgsql-15/share/pg_hba.conf.sample + content => $pg_hba_conf, + }, + exec {'/bin/sed -i "s/#listen_addresses = \'localhost\'/listen_addresses = \'*\' /" /var/lib/pgsql/15/data/postgresql.conf': + unless => '/bin/grep "listen_addresses = \'\\*\'" /var/lib/pgsql/15/data/postgresql.conf', + } + ] + ~> service {'postgresql-15': ensure => running, enable => true, |
