def METHOD_NAME(node: CephNode, data: List) -> None:
    """
    Writes the haproxy.cfg configuration file.
    Args:
        node:   Haproxy client node
        data:   A list having rgw endpoints(ip_address & port)
    Returns:
        None
    Raises:
        CommandFailed
    """
    LOG.info("Generating the HAproxy.cfg file.")
    templ = Template(HAPRX_CONF)
    conf = templ.render(data=data)
    conf_file = node.remote_file(file_name="/etc/haproxy/haproxy.cfg", file_mode="w")
    conf_file.write(conf)
    conf_file.flush()