Yes, its the same information I gathered previously.
I need to search for this string in my when condition:

"exists": true

How can I do that?

Thanks

On Friday, August 26, 2022 at 10:59:12 AM UTC-5 [email protected] wrote:

> Please read the module page for a description of what is "registered" with 
> win_service.
>
> Walter
> --
> Walter Rowe, Division Chief
> Infrastructure Services, OISM
> Mobile: 202.355.4123 <(202)%20355-4123>
>
> On Aug 26, 2022, at 11:53 AM, Nitrous <[email protected]> wrote:
>
> How can I search for this exact string using my example:
>
> "exists": true 
>
> My when condition:
>
> when: lg is search( "exists": true )
>
> It errors out using "exists": true.
>
>
>
> On Friday, August 26, 2022 at 9:27:53 AM UTC-5 Nitrous wrote:
>
>> Thanks, but I have other tasks that depend on my when condition, so I 
>> need to get it right.
>>
>> On Friday, August 26, 2022 at 9:22:37 AM UTC-5 [email protected] wrote:
>>
>>>
>>> https://docs.ansible.com/ansible/latest/collections/ansible/windows/win_service_info_module.html
>>>  
>>> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.ansible.com%2Fansible%2Flatest%2Fcollections%2Fansible%2Fwindows%2Fwin_service_info_module.html&data=05%7C01%7Cwalter.rowe%40nist.gov%7C517b6973bb5f4b923acd08da877b2c57%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637971260336768287%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=OjqHFrwpfAdMoIizlDrvNG6lNpUzMupsTMXErdknrlU%3D&reserved=0>
>>>
>>> On Fri, Aug 26, 2022 at 9:17 AM Nitrous <[email protected]> wrote:
>>>
>>>> Im trying to figure out a way, on how to make a condition exit, if a 
>>>> service is running. 
>>>> If it isnt running, then install it.
>>>>
>>>> My play book looks like below:
>>>>
>>>> - name: Check if LogRhythm System Monitor service is installed
>>>>   win_service:
>>>>     name: lg
>>>>   register: lg
>>>>
>>>> - ansible.builtin.debug:
>>>>     #msg: "state: running found"
>>>>     var: lg
>>>>      #verbosity: 4
>>>>   when: lg is search("runing")
>>>>
>>>> I purposely used the variable "runing" instead of "running", as for new 
>>>> server builds, the service isnt installed and running, so it will install 
>>>> it.
>>>>
>>>> But if the service is "running", how can I modify my existing when 
>>>> condition to skip, if service is "running"?
>>>>
>>>> Thanks.
>>>>
>>>> -- 
>>>> 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/2ee1702e-48eb-4cde-b8d4-5bcc181b2443n%40googlegroups.com
>>>>  
>>>> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F2ee1702e-48eb-4cde-b8d4-5bcc181b2443n%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C517b6973bb5f4b923acd08da877b2c57%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637971260336924510%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=iczMp801P2ttidpsxeZW7FXhBHr43tPSWvW4%2B76NRJA%3D&reserved=0>
>>>> .
>>>>
>>>
> -- 
> 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/6d8f62f6-f7ca-478a-8ac9-703704f9a40fn%40googlegroups.com
>  
> <https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2F6d8f62f6-f7ca-478a-8ac9-703704f9a40fn%2540googlegroups.com%3Futm_medium%3Demail%26utm_source%3Dfooter&data=05%7C01%7Cwalter.rowe%40nist.gov%7C517b6973bb5f4b923acd08da877b2c57%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637971260336924510%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=KZewDQxI6iACuQLyHQTa8aJlFp04S%2Fn%2B9DopKW43hdg%3D&reserved=0>
> .
>
>
>

-- 
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/75a60d25-a8aa-42af-b89e-b94c43725f88n%40googlegroups.com.

Reply via email to