<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)