title: Using with_fileglob for multiple src and destination while copying
body: <p>I need it to deploy multiple config files to a series of directories.</p>
  
  <pre><code>- name: Deploy apache configuration files
    template: src={{ item.src }} dest=/etc/httpd/{{ item.dest }} mode=0644
    with_fileglob:
    - { src: "../templates/apache_templates/conf/*.conf", dest: 'conf' }
    - { src: "../templates/apache_templates/conf.d/*.conf", dest: 'conf.d' }
  </code></pre>
  
  <p>When I run the above task, I get the error below. </p>
  
  <pre><code>An exception occurred during task execution. The full traceback is:
  Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 90, in run
  items = self._get_loop_items()
  File "/usr/lib/python2.7/site-packages/ansible/executor/task_executor.py", line 205, in _get_loop_items
  items = mylookup.run(terms=loop_terms, variables=self._job_vars, wantlist=True)
  File "/usr/lib/python2.7/site-packages/ansible/plugins/lookup/fileglob.py", line 34, in run
  term_file = os.path.basename(term)
  File "/usr/lib64/python2.7/posixpath.py", line 121, in basename
  i = p.rfind('/') + 1
  AttributeError: 'dict' object has no attribute 'rfind'
  
   fatal: [server1.example.com]: FAILED! =&gt; {
  "failed": true, 
  "msg": "Unexpected failure during module execution.", 
  "stdout": ""
  </code></pre>
  
  <p>}</p>
  
  <p>When I replace <code>with_fileglob</code> with <code>with_items</code> in the task above, it throws a <code>msg": "Unable to find '../templates/apache/conf/*.conf' in expected paths."</code> error which is odd because the path does exist.</p>
  
  <p>However when I hard code the configuration files like I did below, the task works as intended.  Writing the task this way defeats the purpose of looping since I have multiple configuration files to deploy</p>
  
  <pre><code>- name: Deploy apache configuration files
    template: src={{ item.src }} dest=/etc/httpd/{{ item.dest }} mode=0644
    with_items:
    - { src: "../templates/apache_templates/conf/vhost1.conf", dest: 'conf' }
    - { src: "../templates/apache_templates/conf.d/example1.conf", dest: 'conf.d' }
  </code></pre>
  
  <p>How can I get this to work?</p>