Commit 0c07a42a authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Christos Stavrakakis
Browse files

Fix db access

Allow password-less access from nodes with webproject.
Allow password-less access from db node.
Signed-off-by: default avatarDimitris Aragiorgis <>
parent 4b84f752
......@@ -416,10 +416,10 @@ def setup_mq():
def allow_access_in_db(ip, user="all", trust=""):
def allow_access_in_db(ip, user="all", method="md5"):
cmd = """
echo host all {0} {1}/32 md5 {2} >> /etc/postgresql/8.4/main/pg_hba.conf
""".format(user, ip, trust)
echo host all {0} {1}/32 {2} >> /etc/postgresql/8.4/main/pg_hba.conf
""".format(user, ip, method)
try_run("/etc/init.d/postgresql restart")
......@@ -442,8 +442,8 @@ def setup_db():
allow_access_in_db(, "all", "trust")
try_run("/etc/init.d/postgresql restart")
allow_access_in_db("", "postgres", "trust")
......@@ -471,7 +471,7 @@ def setup_webproject():
put(custom, tmpl, mode=0644)
with settings(host_string=env.env.db.ip):
host_info = env.env.ips_info[]
allow_access_in_db(host_info.ip, "all", "trust")
try_run("/etc/init.d/gunicorn restart")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment