archive module does not add all the matched files to destination archive file

9 views
Skip to first unread message

Lokesh

unread,
Dec 12, 2017, 9:00:06 AM12/12/17
to Ansible Project
I want to search for files modified last 1day and add them to archive. I dont see all the matched files added to the destination zip file but see only the last file in the zip

ansible --version
ansible 2.3.1.0
  config file = /Volumes/Projects/dat/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.10 (default, Feb  7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]

.......
- name: find files
find:
paths: /var/log/hadoop-hdfs
age: -1d
age_stamp: mtime
file_type: file
register: files_matched

- name: archive found files
archive:
path: "{{ item.path }}"
dest: /tmp/hadoop2.zip
format: zip
with_items: "{{ files_matched.files }}"
Reply all
Reply to author
Forward
0 new messages