title: Conditionals: check type of element
body: <p>I'm looking for a syntax to check if a variable contains any subelements or is just a string. Lets say I have a file <code>vars/myvars.yml</code></p>
  
  <pre><code>myvars: {
    key1: {
      greeting: "hello"
    },
    key2: {
      greeting: {
        en: "hi",
        fr: "bonjour"
      }
    }
  }
  </code></pre>
  
  <p>I'm looking for a condition to only accept a string and no object. So in this case, key1.greeting should match the condition, but key2.greeting should <strong>not</strong>.</p>
  
  <pre><code>---
  - name: test
    vars_files:
      - vars/myvars.yml
    hosts: all
    tasks:
    - debug: 
        msg: "greeting is '{{ item.value.greeting }}'"
      when: item.value.greeting ???is type string???
      with_dict: "{{ myvars }}"
  </code></pre>
  
  <p>Any ideas?</p>