code: def upload_pg_hba_conf(template_name=None, pg_version=None, pg_cluster='main', restart=True):
      
  
      template_name = template_name or u'postgres/pg_hba.conf'
      version = pg_version or detect_version()
      config = {'version': version, 'cluster': pg_cluster}
      destination = u'/etc/postgresql/%(version)s/%(cluster)s/pg_hba.conf' % config
      upload_template(template_name, destination, use_sudo=True)
      if restart:
          restart_service(u'postgresql')
docs: Upload configuration for pg_hba.conf
      If the version is not given it will be guessed.