Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete local directory with ansible

I have to make delete some directory and create them on local before copy to the remote. Is there anyway to delete and create locally?

Currently I'm using 'command'

command: rm -r directory

But warning shows as

Consider using file module with state=absent rather than running rm

Is there any options we can use for local folder changes?

like image 438
Neil Avatar asked Feb 23 '17 19:02

Neil


1 Answers

You can use diffrent delegation methods or use the local_action:

- local_action: file path=directory state=absent
like image 102
flxPeters Avatar answered Sep 22 '22 04:09

flxPeters