'Ansible Could not find or access

I'm trying to make loop with 2 lookup(fileglob) in my task

---
- hosts: localhost
  become: yes
  become_user: root

  tasks:

    - name: Loop with 2 lookup
      copy:
        src: '{{ item.src }}'
        dest: '{{ item.dest }}'
      loop: 
        - { src: "{{ lookup('fileglob', 'custom_scripts/*', wantlist=True) }}",  dest: /var/custom_scripts/ }
        - { src: "{{ lookup('fileglob','certs/*', wantlist=True) }}", dest: /var/custom_certs/ }

When i try to run this i get Could not find or access "path to files" in error log ansible is seeing all this files, because is listing all files which can't access. Permissions for all folders and files are set on 777



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source