Hi Jordan, can you please assist here ?

On Sun, Jan 24, 2021 at 3:08 PM [email protected] <[email protected]> wrote:

> Hi
> Trying to use win_service_info with a register.
> While the register is filled with multiple entries, i want to make sure
> all these are started.
> How to write the loop ?
>
>   - name: Find all services that start with 'blabla'
>     ansible.windows.win_service_info:
>       name: blabla*
>     register: service
>
> #Print everything
>   - name: Print service facts
>     ansible.builtin.debug:
>       var: service
>
> #Print only the first one
>   - name: Print service facts
>     ansible.builtin.debug:
>       var: service.services[0].name
>
> *  - name: make sure service is started*
> *    win_service:*
> *      name: 'service.services[{{ item }}].name'*
> *      state: started*
> *    with_items: service.services.index ?*
>
> Thanks!
>
> cc @jborean93
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/iWsksxxaAaY/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/00316553-786f-4d4b-96c8-abc85726cfebn%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/00316553-786f-4d4b-96c8-abc85726cfebn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAAK4BEYnYm2_%2B1QooJNdLCitBGZoJeYVVs2ArkehOsukLmpXtw%40mail.gmail.com.

Reply via email to