The above request was registered to a variable called "status", but since
you are using with_sequence this is saved in an array.
Take a look at what you have like so:
- debug: var=status
Finally, you'll probably see that you want:
- debug: msg="{{ item.stdout }}
with_items: status
item doesn't mean anything unless there's a loop in play, so you have to
loop over status to use it.
On Fri, Jun 20, 2014 at 11:20 PM, Александр Лозовской <[email protected]>
wrote:
> Hi! How i can get stdout using loop (f.e. for with_sequence statement)?
>
> An example of how I want to use it:
>
> Введите код...
>
>
> -
>
> hosts: 127.0.0.1
> connection: local
> gather_facts: no
>
> tasks:
> -
>
> name: "TEST"
> command: curl -o /dev/null --silent --head --write-out
> "%{http_code}" http://host"{{ item }}":80
> register: status
> with_sequence: count=4
> -
>
> debug: msg="{{ item.stdout }}"
>
>
> --
> 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/a6e732c4-0fcb-4bba-9036-674d9fb92b06%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/a6e732c4-0fcb-4bba-9036-674d9fb92b06%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%2BnsWgx7Xz9KjH_tVP-4tLUPvGfzLwDsy5Jvy%2BN%2BW3MQur7Feg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.