title: How to "slurp" multiple files with Ansible
body: <p>With Ansible, I need to extract content from multiple files. With one file I used slurp and registered a variable.</p>
  
  <pre><code>- name: extract nameserver from .conf file
    slurp:
      src: /opt/test/roles/bind_testing/templates/zones/example_file.it.j2
    delegate_to: 127.0.0.1
    register: file
  
  - debug:
     msg: "{{ file['content'] | b64decode }}"
  </code></pre>
  
  <p>But now I have multiple files so I need to extract content from every files, register them one by one to be able to process them later with operations like sed, merging_list etc...</p>
  
  <p>How can I do this in ansible?</p>
  
  <p>I tried to use slurp with with_fileglob directive but I couldn't register the files...</p>
  
  <pre><code>- name: extract nameserver from .conf file
    slurp:
      src: "{{ item }}"
    with_fileglob:
      - "/opt/test/roles/bind9_domain/templates/zones/*"
    delegate_to: 127.0.0.1
    register: file
  
  </code></pre>