---
- name: Create files
  shell: |
    touch -d "15 days ago" /tmp/file15d
    touch -d "60 days ago" /tmp/file60d
  args:
    executable: /bin/bash
    warn: false

- name: Find files > 30d
  find:
    paths: /tmp
    patterns: 'file*'
    age: 30d
    age_stamp: mtime
  register: output

- name: Delete files
  file:
    path: "{{ item.path }}"
    state: absent
  with_items: "{{ output.files }}"
