0

So, I am trying to recursively delete a directory with all files/folders inside. I tried:

  - name: Cleaning up
    file:
      state: absent
      path: /tmp/myfolder/

But the directory did not get deleted. Is there any force/recursive parameter I can add? What am I missing?

  • 2
    I cannot reproduce this at all - were there any error messages? Are you sure you're targetting the correct host? Is the task "ok" or "changed"? – Bruce Becker Dec 1 at 15:13
  • @BruceBecker The task is changed. I did install files from this directory before, so maybe there is still some process in the background that is not completed that prevents deleting the directory? But I did not get any error prompt. – Kyu96 Dec 1 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.