with_items and with_sequence used together

507 views
Skip to first unread message

Christopher Stobie

unread,
Sep 30, 2016, 4:46:26 PM9/30/16
to Ansible Project
Is this currently possible?

Brian Coca

unread,
Sep 30, 2016, 5:17:31 PM9/30/16
to ansible...@googlegroups.com
There can only be 1 `with_` per task, but the 2nd part is a lookup (with_<lookup plugin>), which you can stack in other ways.

with_items:
  - "{{lookup('sequence', ...)}}"


----------
Brian Coca

Dick Davies

unread,
Oct 4, 2016, 9:53:10 AM10/4/16
to ansible list
lookup('sequence', ....) looks very handy for something I need to implement

that is a really ugly currently (include + with_flattened +
loop_control + loop_var).

Is the use of that documented anywhere?
> --
> 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-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CACVha7e6pJq-0eP6Sk_TtuCa54t06jw69L8dm8jpwy5HpSivJQ%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

Kai Stian Olstad

unread,
Oct 4, 2016, 11:17:16 AM10/4/16
to ansible...@googlegroups.com
On 04. okt. 2016 15:53, Dick Davies wrote:
> lookup('sequence', ....) looks very handy for something I need to implement
>
> that is a really ugly currently (include + with_flattened +
> loop_control + loop_var).
>
> Is the use of that documented anywhere?

Seams to be only documented in the code
https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/lookup/sequence.py#L43-L79


--
Kai Stian Olstad
Reply all
Reply to author
Forward
0 new messages