There's no concept of looping over roles presently. If you mean passing a list to a role, that's fine, and you can do that.
There's a fundamental reason this is done, in that the role must be applied in the same definition (but not the same variables) to each host in the host group. Ergo, you can't have different numbers of roles applied to different hosts in the same group based on some kind of inventory variance. (So you should make a role that can take a list of input items, and then loop over it internally) On Mon, Jan 20, 2014 at 8:42 AM, Nick <[email protected]> wrote: > Hello, > > I wondered if this previously-posted hack to loop over roles still the > best option out there? (i.e. Without the need to modify the role in > question to unroll the loops at a task level, as advocated as a workaround > otherwise.) > > "Looping over roles ?" 5th Nov 2013 > https://groups.google.com/d/topic/ansible-project/3D81SEUoNuQ/discussion > > Is there any plan afoot to implement something in core to do something > equivalent in a nicer (and unbounded) way? > > I say this hopefully, in the belief that it would make role design easier > and less error prone: you would only need to think about the simple case of > one instance. > > Thanks, > > N > > -- > 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]. > For more options, visit https://groups.google.com/groups/opt_out. > -- Michael DeHaan <[email protected]> CTO, AnsibleWorks, Inc. http://www.ansibleworks.com/ -- 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]. For more options, visit https://groups.google.com/groups/opt_out.
