Revision 108fbde6 snf-deploy/fabfile.py

b/snf-deploy/fabfile.py
416 416

  
417 417

  
418 418
@roles("db")
419
def allow_access_in_db(ip, user="all", trust=""):
419
def allow_access_in_db(ip, user="all", method="md5"):
420 420
    cmd = """
421
    echo host all {0} {1}/32 md5 {2} >> /etc/postgresql/8.4/main/pg_hba.conf
422
    """.format(user, ip, trust)
421
    echo host all {0} {1}/32 {2} >> /etc/postgresql/8.4/main/pg_hba.conf
422
    """.format(user, ip, method)
423 423
    try_run(cmd)
424 424
    try_run("/etc/init.d/postgresql restart")
425 425

  
......
442 442
    """
443 443
    try_run(cmd)
444 444

  
445
    allow_access_in_db(env.host, "all", "trust")
445 446
    try_run("/etc/init.d/postgresql restart")
446
    allow_access_in_db("127.0.0.1", "postgres", "trust")
447 447

  
448 448

  
449 449
@roles("db")
......
471 471
    put(custom, tmpl, mode=0644)
472 472
    with settings(host_string=env.env.db.ip):
473 473
        host_info = env.env.ips_info[env.host]
474
        allow_access_in_db(host_info.ip)
474
        allow_access_in_db(host_info.ip, "all", "trust")
475 475
    try_run("/etc/init.d/gunicorn restart")
476 476

  
477 477

  

Also available in: Unified diff