1
我有以下ansible劇本:排除在嵌套目錄中的特定文件使用ansible同步模塊
- 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"
在那裏我試圖同步包含子目錄的目錄。
我想特別從applogs/internal目錄的子目錄中排除特定文件格式的特定文件。我已經試過指定如上所示的路徑,但是當使用同步模塊時,我仍然得到這些文件。有沒有辦法讓我使用--exclude排除主目錄的子目錄的文件?
這可能是因爲我使用1.9.2版本 – Zee