Hi,
I was trying to do something using synchronize where I exclude some files and include others, but it does not work like rsync:
So, this works with rsync,
- name: testrsync
local_action: command rsync -aH --include ‘[e|p]’ --exclude '’ prmfiles/output/{{ item.key }}/ {{ ansible_user_id }}@{{ inventory_hostname }}:/export/home/oracle/hhenjum/heathtest/
when: oggaction == “prmfiles”
with_dict: dirprm | default({})
But, when I try to do this with synchronize, I can’t get it to work. It just passes through saying the step is “ok”… or no changes to do.
- name: testsync
synchronize: src=prmfiles/output/{{ item.key }}/ dest=/export/home/oracle/hhenjum/heathtest/ checksum=yes rsync_opts=“rsync_opts=–include=‘e*’, --exclude=‘*’”
when: oggaction == “prmfiles”
with_dict: dirprm | default({})
If I don’t have the double quotes around rsync_opts, then it gives me, msg: unsupported parameter for module: --exclude
I imagine this is something with the wildcards? Also, I understand it probably wasn’t the intention for rsync_opts to handle everything you can do with rsync.
It’s not a huge issue. I just changed the deploy so that we can just sync the whole directory rather than specific files, but I thought I’d check in case it should work.
Thanks,
Heath