title: How to check if registered variable has a particular pattern in ansible?
body: <p>So I want to check if nginx syntax is ok</p>
  
  <pre><code>- name: check if syntax is ok on nginx
    shell: nginx -t
    register: result
  </code></pre>
  
  <p>then I want to use that with the service module with "when:" conditional to run the service module to reload nginx "when:" "result" has in it "syntax is ok".</p>
  
  <p>Would something like this work?</p>
  
  <pre><code>when: result.stdout_lines == "syntax is ok"
  </code></pre>