Nitrous
(Nitrous)
August 26, 2022, 2:17pm
1
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:
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.
Nitrous
(Nitrous)
August 26, 2022, 2:27pm
3
Thanks, but I have other tasks that depend on my when condition, so I need to get it right.
Nitrous
(Nitrous)
August 26, 2022, 3:53pm
4
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.
Please read the module page for a description of what is “registered” with win_service.
Walter
Nitrous
(Nitrous)
August 26, 2022, 4:13pm
6
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
Think it through … what is the structure of the data in ‘lg’ after win_service? You have to learn to decipher structured data so you can learn how to reference it.
Walter