Right. Which is why I suggested printing it out with a debug statement.
You should then be able to determine the best way to split/join to isolate
your output and then use a subsequent when statement to decide if to
proceed with the desired update. Make sense?
On Friday, October 12, 2018 at 11:22:40 AM UTC-4, alexis calvayrac wrote:
>
> Yes, I can actually do as you say and not go through a text file. The
> purpose of this playbook is to do nothing if the right version is installed
> and otherwise install the right one.
>
> Something like.
>
> If {{ result }} != "Version 5"
> then
> install Version 5
> fi
>
> But I don't know how to isolate and test the string "Version: x" directly
> in Ansible
>
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/6d5ebd6f-990a-4436-94da-2c2c75f44f08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.