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.
On Mon, Jun 8, 2015 at 12:11 PM, richard kappler <[email protected]> wrote: > 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 > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > 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 -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ5XC8nR30n7noRzt5-1PDxKf0LzK5q6pCXkVyVGdM%2B09NLuXw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
