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.