I am running an ansible-playbook which is doing running tar command to zip a directory. Following is the ansible task.
  - name: tar the old code
    command: tar -czf {{ansible_date_time.date}}.tar.gz /home/ubuntu/my-folder
The above gives the following error.
"warnings": use unarchive module rather than running tar stderr: tar: Removing leading '/' from member names tar: /home/ubuntu/my-folder/xyz.log: file change as we read it
I also tried with option --ignore-failed-read but it didn't zipped the directory but ran the rest of the tasks successfully.
  - name: tar the old code
    command: tar -czf {{ansible_date_time.date}}.tar.gz /home/ubuntu/my-folder  --ignore-failed-read
Since this task is in between other tasks, the tasks which has to be run after this one fails.
ansible doesn't give module to tar the code. only unarchive module is there to unzip the directory.