title: Ansible - condition if a variable value exists in a variable
body: <p>I am running a task which i only want to execute if the value of a variable that i have previously set does not exist in another variable. I have tried the following but it errors with a templating error:</p>
  
  <pre><code>name: get ip address
  ...
  register: ipaddress
  
  name: check cluster
  ....
  register: topology
  
  name: do my task
  ...
  when: not topology is search(ipaddress)
  </code></pre>
  
  <p>Is there any way in ansible to accomplish what i am doing? I'm using version 2.6.</p>