Re: [ansible-project] win_service_info register

2022-09-29 Thread ftpk...@gmail.com
HI Jordan, I am wondering how I could modify the above code to only start when a service exist with out ignoring errors as an option. On Monday, January 25, 2021 at 6:53:03 AM UTC-5 jer...@gmail.com wrote: > Thank you! > I wonder why i didn't try it... > > On Sun, Jan 24, 2021 at 9:28 PM jbor..

Re: [ansible-project] win_service_info register

2021-01-25 Thread Jeremie Levy
Thank you! I wonder why i didn't try it... On Sun, Jan 24, 2021 at 9:28 PM jbor...@gmail.com wrote: > Just loop the services entry and then your item is item.name. > > - win_service: > name: '{{ item.name }}' > state: started > with_items: '{{ service.services }}' > > This works becaus

Re: [ansible-project] win_service_info register

2021-01-24 Thread jbor...@gmail.com
Just loop the services entry and then your item is item.name. - win_service: name: '{{ item.name }}' state: started with_items: '{{ service.services }}' This works because service.services is a list that contains a dictionary so you are looping each entry and then getting the name key

Re: [ansible-project] win_service_info register

2021-01-24 Thread Jeremie Levy
Hi Jordan, can you please assist here ? On Sun, Jan 24, 2021 at 3:08 PM jer...@gmail.com 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 a

[ansible-project] win_service_info register

2021-01-24 Thread jer...@gmail.com
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: se