code: def add_host(self, host, group_names=None, host_vars=None):
          gnames = group_names if group_names else []
          hvars = host_vars if host_vars else {}
          gnames.sort()
          hvars[A.server.GROUP_NAMES] = gnames
          hvars[A.server.INV_NAME] = host
          hvars[A.server.INV_NAME_SHORT] = host.split('.')[0]
          self.groups_and_vars.merge(host, hvars)
          for gname in group_names:
              self.groups_and_vars.append(gname, host)