Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
loop
33 views
Skip to first unread message
starflighter one
unread,
Jun 12, 2019, 8:13:58 AM
6/12/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hi all,
how can I write with_first_found as loop?
I can't find an example at
https://docs.ansible.com/ansible/devel/porting_guides/porting_guide_2.5.html#migrating-from-with-x-to-loop
Can you give me an example?
Thanks,
starflighter
Ryad karkar
unread,
Jun 12, 2019, 8:39:30 AM
6/12/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hi,
You can see one exemple for loop :
-
name
:
"
with_list -> loop"
debug
:
msg
:
"
{{
item
}}
"
loop
:
-
my first word
-
my second word
When i execut this task, the result is :
[item=1] => my first word
[item=2] => my second word
Do you understand ?
Regards,
Martin Krizek
unread,
Jun 12, 2019, 9:03:01 AM
6/12/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Hello,
you can find an example of using `first_found` with `loop` here:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html#selecting-files-and-templates-based-on-variables
.
Thanks,
Martin
> --
> 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/217b6472-47c3-414c-ae84-a67332f179b3%40googlegroups.com
.
> For more options, visit
https://groups.google.com/d/optout
.
starflighter one
unread,
Jun 13, 2019, 1:38:49 AM
6/13/19
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Hi Martin,
that is what I was looking for.
Thank you.
starflighter
Reply all
Reply to author
Forward
0 new messages