From cc5319b112f24a9c0a87d514e38fefe9a093ec75 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 30 Sep 2019 08:01:51 +0200 Subject: [PATCH] udd wants guest access on localhost --- modules/roles/manifests/buildd_master/db_guest_access.pp | 6 ++++-- modules/roles/manifests/udd.pp | 1 + modules/roles/manifests/udd/db_guest_access.pp | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/roles/manifests/buildd_master/db_guest_access.pp b/modules/roles/manifests/buildd_master/db_guest_access.pp index edc529da2..bacd7dbac 100644 --- a/modules/roles/manifests/buildd_master/db_guest_access.pp +++ b/modules/roles/manifests/buildd_master/db_guest_access.pp @@ -3,17 +3,19 @@ # @param db_address hostname of the postgres server for this service # @param db_port port of the postgres server for this service # @param database list of databases to give access to +# @param address hosts to give access class roles::buildd_master::db_guest_access ( String $db_address = $roles::buildd_master::params::db_address, Integer $db_port = $roles::buildd_master::params::db_port, - Array[String] $database = ['wanna-build'] + Array[String] $database = ['wanna-build'], + Optional[Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]] $address = $base::public_addresses, ) inherits roles::buildd_master::params { @@postgres::cluster::hba_entry { "buildd_master-guest-${::fqdn}": tag => "postgres::cluster::${db_port}::hba::${db_address}", pg_port => $db_port, database => $database, user => 'guest', - address => $base::public_addresses, + address => $address, method => 'trust', order => '30', } diff --git a/modules/roles/manifests/udd.pp b/modules/roles/manifests/udd.pp index 4267b0bd3..16c8b9f33 100644 --- a/modules/roles/manifests/udd.pp +++ b/modules/roles/manifests/udd.pp @@ -13,5 +13,6 @@ class roles::udd { class { 'roles::udd::db_guest_access': database => ['udd', 'udd-dev'], + address => ['127.0.0.1', '::1'], } } diff --git a/modules/roles/manifests/udd/db_guest_access.pp b/modules/roles/manifests/udd/db_guest_access.pp index cec9b1e0a..38af91ed4 100644 --- a/modules/roles/manifests/udd/db_guest_access.pp +++ b/modules/roles/manifests/udd/db_guest_access.pp @@ -3,17 +3,19 @@ # @param db_address hostname of the postgres server for this service # @param db_port port of the postgres server for this service # @param database list of databases to give access to +# @param address hosts to give access class roles::udd::db_guest_access ( String $db_address = $roles::udd::params::db_address, Integer $db_port = $roles::udd::params::db_port, - Array[String] $database = ['udd'] + Array[String] $database = ['udd'], + Optional[Variant[Stdlib::IP::Address, Array[Stdlib::IP::Address]]] $address = $base::public_addresses, ) inherits roles::udd::params { @@postgres::cluster::hba_entry { "udd-guest-${::fqdn}": tag => "postgres::cluster::${db_port}::hba::${db_address}", pg_port => $db_port, database => $database, user => 'guest', - address => $base::public_addresses, + address => $address, method => 'trust', order => '30', } -- 2.20.1