def do_bulk_config_update(hostnames):
  """
  Given a list of hostnames, update the configs of all the
  datanodes, tasktrackers and regionservers on those hosts.
  """
  api = ApiResource(CM_HOST, username=CM_USER, password=CM_PASSWD)
  hosts = collect_hosts(api, hostnames)

  # Set config
  for h in hosts:
    configure_roles_on_host(api, h)