From 9d18ca79797f2fad7dde59cad6b3f9f782be91c5 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 7 Dec 2010 02:40:32 +0000 Subject: - use a loop, and a fact, instead of cut and paste and hardcoded ip --- modules/postgresql/templates/pg_hba.conf | 35 ++++++++++++-------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/modules/postgresql/templates/pg_hba.conf b/modules/postgresql/templates/pg_hba.conf index 4dd9906c..57b46162 100644 --- a/modules/postgresql/templates/pg_hba.conf +++ b/modules/postgresql/templates/pg_hba.conf @@ -80,25 +80,20 @@ # Nanar: # This bypass global config for specific user/base -host epoll epoll 127.0.0.1/32 md5 -host epoll epoll ::1/128 md5 -hostssl epoll epoll 212.85.158.146/32 md5 -hostssl epoll epoll 2a02:2178:2:7::2/128 md5 +<% -host mirrors mirrors 127.0.0.1/32 md5 -host mirrors mirrors ::1/128 md5 -hostssl mirrors mirrors 212.85.158.146/32 md5 -hostssl mirrors mirrors 2a02:2178:2:7::2/128 md5 - -host transifex transifex 127.0.0.1/32 md5 -host transifex transifex ::1/128 md5 -hostssl transifex transifex 212.85.158.146/32 md5 -hostssl transifex transifex 2a02:2178:2:7::2/128 md5 - -host bugs bugs 127.0.0.1/32 md5 -host bugs bugs ::1/128 md5 -hostssl bugs bugs 212.85.158.146/32 md5 -hostssl bugs bugs 2a02:2178:2:7::2/128 md5 +# FIXME ip v6 is hardcoded, facter do not seems to support +# fetch it +db = ['epoll','mirrors','transifex','bugs','sympa'] +for i in db +%> +host <%= i %> <%= i %> 127.0.0.1/32 md5 +host <%= i %> <%= i %> ::1/128 md5 +hostssl <%= i %> <%= i %> <%= ipaddress %>/32 md5 +hostssl <%= i %> <%= i %> 2a02:2178:2:7::2/128 md5 +<% +end +%> # When creating the database ( with bin/checkstup.pl ) bugzilla need to # access to template1 ( https://bugzilla.mozilla.org/show_bug.cgi?id=542507 ) @@ -107,10 +102,6 @@ host template1 bugs ::1/128 md5 hostssl template1 bugs 212.85.158.146/32 md5 hostssl template1 bugs 2a02:2178:2:7::2/128 md5 -host sympa sympa 127.0.0.1/32 md5 -host sympa sympa ::1/128 md5 -hostssl sympa sympa 212.85.158.146/32 md5 -hostssl sympa sympa 2a02:2178:2:7::2/128 md5 # "local" is for Unix domain socket connections only local all all ident map=local -- cgit v1.2.1