title: Create a file for each name in variable in Ansible
body: <p>I am currently trying to do something in Ansible
  I currently have a variable</p>
  <pre class="lang-yaml prettyprint-override"><code>this_directories:
    - { name: &quot;derp&quot;, path: &quot;/var/log/derp&quot; }
    - { name: &quot;memes&quot;, path: &quot;/var/lib/memes/containers&quot; }
    - { name: &quot;docker&quot;, path: &quot;/var/lib/docker&quot; }
    - { name: &quot;lib&quot;, path: &quot;/var/lib&quot; }
  </code></pre>
  <p>I want to create a multiple files with content for each name in <code>this_directories</code></p>
  <p>so make a new file</p>
  <pre><code>derp
  memes
  docker
  lib
  </code></pre>
  <p>I tried a task like this</p>
  <pre class="lang-yaml prettyprint-override"><code>- copy:
      dest: &quot;/etc/{{ this_directories.name }}&quot;
      content: |
        {{this_directories}} {
        rotate 12
        size 10M
        weekly
        compress
        missingok
        notifempty
        copytuncate
        }
  </code></pre>
  <p>But I don't think this is right.</p>