def setup_hosts_file(hosts):
    with fab.settings(user='root'):
        for host, ip in hosts.items():
            fab.run("echo '{ip} {host}' >> /etc/hosts".format(ip=ip, host=host), quiet=True)
Setup /etc/hosts
dataset/ETHPy150Open datastax/cstar_perf/tool/cstar_perf/tool/fab_deploy.py/setup_hosts_file