Revision 34e315ac snf-deploy/fabfile.py

b/snf-deploy/fabfile.py
409 409

  
410 410

  
411 411
@roles("db")
412
def allow_access_in_db(ip):
412
def allow_access_in_db(ip, user="all", trust=""):
413 413
    cmd = """
414
    echo host all all {0}/32 md5 >> /etc/postgresql/8.4/main/pg_hba.conf
415
    """.format(ip)
414
    echo host all {0} {1}/32 md5 {2} >> /etc/postgresql/8.4/main/pg_hba.conf
415
    """.format(user, ip, trust)
416 416
    try_run(cmd)
417 417
    try_run("/etc/init.d/postgresql restart")
418 418

  
......
436 436
    try_run(cmd)
437 437

  
438 438
    try_run("/etc/init.d/postgresql restart")
439
    allow_access_in_db("127.0.0.1", "postgres", "trust")
439 440

  
440 441

  
441 442
@roles("db")

Also available in: Unified diff