On 06.02.17 16:38 'Tom Bartsch' via Ansible Project wrote:

> My problem now is that if I call this playbook with "hosts=product"
> it will generate each of the group jobs 4 times. So it's 3 times to
> much.

Two ideas:

You can have more than one play in a playbook.

###############
- hosts: just_one_host
  tasks:
  - name: Add group job
  ...

- hosts: product
  tasks:
  - name: Add jobs per host
  ...
###############

Calling this via "ansible-playbook foobar.yml" executes first the task
on only one machine, creating the group job, and then runs the tasks
on all machines.

The other idea is to make your task see, if the group job has been
defined before. I do not know (and you did not tell) how you create
your jobs, but maybe you can check for existence of the jobs and only
create them, if necessary.

Johannes

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/63f37f70-de61-4e07-a5ad-79958ed84514%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to