In ansible how can we include all task files in a directory
<p>I have a directory with task files and I want to loop through those task files and include them in my playbook. How can I do this?</p>

<p>I tried the following but that does not seem to work,</p>

<pre><code>- include: "{{ item }}"
  with_items: export.stdout_lines    
</code></pre>

<p>This gives me an error,</p>

<pre><code>ERROR: [DEPRECATED]: include + with_items is a removed deprecated feature.  Please update your playbooks.
</code></pre>

<p>I looked at other posts on stackoverflow for that particular error and the workaround but it does not seem to be relevant to my problem. </p>

<p>I am using ansible 1.9.4.</p>