title: How can I write variables inside the tasks file in ansible
body: <p>I have this <em>play.yml</em></p>
  <pre class="lang-yaml prettyprint-override"><code>---
  - hosts: localhost
      
    tasks:
      - include: apache.yml
  </code></pre>
  <p>My <em>apache.yml</em> file looks like this:</p>
  <pre class="lang-yaml prettyprint-override"><code>vars:
    url: http://example.com/apache
      
  - name: Download apache
    shell: wget {{ url }} 
  </code></pre>
  <p>This is giving me an error.</p>
  <p>If I remove <code>vars</code> then it works. But, I want to keep the variable inside the included tasks file, so that I can keep different variables for different tasks separate.</p>