0

I'm trying to delete all files which have the prefix git from the directory /usr/local/bin/ and /usr/bin/. But ansible don't seem to delete the files.

I tried using file module:

  file:
    path: "{{ item }}"
    state: absent
  with_items: 
    - '/usr/local/bin/git*'
    - '/usr/bin/git*'

but it's not working.

tink
  • 14,342
  • 4
  • 46
  • 50
Aswin K R
  • 29
  • 1
  • 8
  • 3
    file's `path:` doesn't do globbing. Use `find` with `pattern` to gather the items and then delete them ... – tink May 08 '23 at 04:26

0 Answers0