>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.
The include playbook does not include more than a list of roles I want to apply. The use case is the following:
- We have multiple projects/apps in our company, where each project requires some different roles as environment. So in additiona to a file with custom variables, I want to be able to define the roles being necessary for the project. Right now we have a simple playbook which only consists of a short list of required roles for that (see first example playbook). Then, this playbook is picked up to provision different machines for the project, e.g. a vagrant box or some staging environment. For that we've got different master playbooks (vagrant, staging, ..) where it provisions the environment + includes the project specific playbook to take care of project specifics.
For that, having a simple playbook which only consists of a short list of required roles seems a good fit here. Having the roles specified in some sort of variable would be possible as well, but I'd prefer to not have to pre-define the list of possible roles somewhere.
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 :)
If the project specific playbook contains role A depending on role B and the environment-provision playbook (e.g. staging) contains role C depending on role B, role B will unnecessarily run twice as it runs in two different plays. If I could merge the list of roles into a single play, ansible would detect the shared dependency and run role B only once. That would be optimal then - that's why I'm asking whether there is a way the roles somehow?
Thanks for your help!