Excluding specific files in a nested directory using ansible synchronize module
<p>I have the following ansible playbook: </p>

<pre><code>- hosts: loghost
  tasks:
    - name: Get logs
      synchronize:
        src: /home/app/logs/
        dest: /central/logs/applogs/{{inventory_hostname}}
        dirs: yes
        mode: pull
        rsync_opts:
            - "--exclude=backup"
            - "--exclude=target"
            - "--exclude=internal/client/.ods"
            - "--exclude=internal/exchange/.ods"
</code></pre>

<p>where I am trying to synchronize a directory that contains sub-directories.</p>

<p>I want to exclude specific files with a specific file format in the subdirectories specifically from the applogs/internal directory. I've tried specifying the path as shown above but Im still getting these files when using the synchronize module. Is there a way for me to exclude a the main directory's subdirectory's files using --exclude? </p>