Ansible condition when string not matching

Question:

I am trying to write an Ansible playbook that only compiles Nginx if it’s not already present and at the current version. However it compiles every time which is undesirable.

This is what I have:

The script all works apart from the fact that it runs the shell script every time to compile Nginx. The debug output for nginxVersion is:

According to the documentation I am on the right lines, what simple trick am I missing?

Answer:

Try:

or

Leave a Reply