title: Ansible passing hash to include module
body: <p>I have problems to pass some composite data like a YAML mapping as input for the ansible include module.</p>
  
  <p>Here is my test:</p>
  
  <p>test.yml</p>
  
  <pre><code>---
  - hosts: all
    gather_facts: no
    vars:
      test_var:
        test1:
          hello: world
          hi: people
        test2:
          hello2: world2
          hi2: people2
    tasks:
      - debug: "msg='Variable item.value is: {{ item.value }}'"
        with_dict: "{{ test_var.test1 }}"
      - include: "test1.yml test_variable={{ item.value }}"
        with_dict: "{{ test_var.test1 }}"
  </code></pre>
  
  <p>test1.yml</p>
  
  <pre><code>---
  - debug: "var={{ test_variable }}"
  </code></pre>
  
  <p>Here is the output. Notice the part with: <code>"people": "VARIABLE IS NOT DEFINED!"</code></p>
  
  <pre><code>$ ansible-playbook -i localhost, test.yml
  
  PLAY ***************************************************************************
  
  TASK [debug] *******************************************************************
  ok: [localhost] =&gt; (item={'value': u'people', 'key': u'hi'}) =&gt; {
      "item": {
          "key": "hi",
          "value": "people"
      },
      "msg": "Variable item.value is: people"
  }
  ok: [localhost] =&gt; (item={'value': u'world', 'key': u'hello'}) =&gt; {
      "item": {
          "key": "hello",
          "value": "world"
      },
      "msg": "Variable item.value is: world"
  }
  
  TASK [include] *****************************************************************
  included: /home/mot/jira-scripts/ansible-playbooks/test1.yml for localhost
  included: /home/mot/jira-scripts/ansible-playbooks/test1.yml for localhost
  
  TASK [debug] *******************************************************************
  ok: [localhost] =&gt; {
      "people": "VARIABLE IS NOT DEFINED!"
  }
  
  TASK [debug] *******************************************************************
  ok: [localhost] =&gt; {
      "world": "VARIABLE IS NOT DEFINED!"
  }
  
  PLAY RECAP *********************************************************************
  localhost                  : ok=5    changed=0    unreachable=0    failed=0
  </code></pre>