title: Ansible - Trigger Fail when string not in variable
body: <p>I'm gathering facts via SNMP but I want trigger a failure if a string is not found within one of the OID responses.</p>
  
  <p>Below is my Playbook. But I cannot get it to trigger.</p>
  
  <p>Note: Im using Ansible 2.8.3</p>
  
  <pre><code> tasks:
      - name: "TASK 1: GATHER FACTS VIA SNMP"
        snmp_facts:
          host: "{{ ansible_host }}"
          version: v3
          level: authPriv
          integrity: sha
          privacy: aes
          username: "{{ item.user }}"
          authkey: "{{ item.pwd }}"
          privkey: "{{ item.privacy }}"
        with_items: "{{ snmp_users }}"
        delegate_to: localhost
        notify: snmp_facts_collected
  
      - debug:
          msg: "SNMP System Name: {{ ansible_sysname }} SNMP OID: {{ ansible_sysobjectid }} ansible_sysdescr {{ ansible_sysdescr }} "
  
    handlers:
      - name: "HANDLER 1: Check SNMP Response"
        listen: snmp_facts_collected
        fail:
          msg: parse err
        when: "{{ 'Xisco NX-OS' not in ansible_sysdescr }}"
  </code></pre>