I don't know what "stopped working" means, so when you say something doesn't work, I'd need to see output. I'm also unclear what the value for playbook was and would need to see the file in context, whereas it seems to be an incomplete snippet above, so it's hard to say what I should suggest.
I also do not understand this part of the equation: "Besides that, the solution isn't optimal as afterwards I've to run some more roles on the same hosts, but if the dependencies of both roles overlap the dependencies get now executed twice." It sounds like you are applying the same role to the same hosts in more than one play, in which case they will run twice, basically because they were asked to do so :) On Thu, Sep 4, 2014 at 3:59 PM, Wolfgang Ziegler <[email protected]> wrote: > I've a setup of multiple projects, where each project specified the roles > it works with via a playbook like the following: > > # Ansible playbook. > # Has to be included in a top level playbook and the hosts variable set. > --- > - hosts: "{{ hosts }}" > roles: > - { role: somerole } > Code hier eingeben... > > Now I include this in the main playbook like the following: > > include: "{{ playbook }} hosts=some-hosts" > > Now, there is the problem that in 1.7.1 this stopped working due to the > variable in the include, which I already mentioned over at > https://groups.google.com/forum/#!searchin/ansible-project/playbook$20include/ansible-project/Fd8HJ2bgTeE/QZM9QwBqEEMJ > . > > Besides that, the solution isn't optimal as afterwards I've to run some > more roles on the same hosts, but if the dependencies of both roles overlap > the dependencies get now executed twice. Instead, I'd love to be able to > merge both playbooks into one or have a way to include some additional > roles in one main play - that way the dependencies would be properly > handled. > > I'd tried something like following: > > # Ansible playbook. > --- > - hosts: my-hosts > vars_files: > - "{{ vars-with-roles-specified }}" > roles: defined_roles + > - { role: another_role } > Code hier eingeben... > > However it seems that roles cannot be specified using variables at all. > Any suggestions on how to achieve that best? > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/8e55db1f-acba-40d2-b0a8-618e57d41ff2%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/8e55db1f-acba-40d2-b0a8-618e57d41ff2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyYs3qqteHzweNxRG7ftmSW5fDrBvfTHKQTGS5PYhHyCA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
