delete a remote file

111 views
Skip to first unread message

richard kappler

unread,
Jun 8, 2015, 12:58:02 PM6/8/15
to ansible...@googlegroups.com
What is the proper way to delete a remote file. Example: If I've used Ansible to copy a file to a remote server, how do I delete it from ansible?

I've looked in the docs, googled it, tried using the shell command with rm, also with src=<filename> removes=True; I've tried the same in command, I've even tried file: path=~/<filename> state=absent

I'm getting no errors, but when I go check the remote server, the file is still there.

regards, Richard

Brian Coca

unread,
Jun 8, 2015, 12:59:00 PM6/8/15
to ansible...@googlegroups.com
Your file command is the correct one to use, just note that
path=~/<filename> will depend on the remote user. try using the full
path when in doubt.
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/13f39357-b718-4207-9fdd-a971aaabe7aa%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca

richard kappler

unread,
Jun 9, 2015, 10:56:40 AM6/9/15
to ansible...@googlegroups.com
Brilliant, thanks!
Reply all
Reply to author
Forward
0 new messages