'Enqueue a job on the given hosts.'

def queue(self, hosts, profiles, atomic_group=None, is_template=False):

    if (not hosts):
        if atomic_group:
            atomic_group.enqueue_job(self, is_template=is_template)
        else:
            entry = HostQueueEntry.create(job=self, profile='N/A', is_template=is_template)
            entry.save()
        return
    if (not profiles):
        profiles = ([''] * len(hosts))
    for (host, profile) in zip(hosts, profiles):
        host.enqueue_job(self, profile=profile, atomic_group=atomic_group, is_template=is_template)
