I would use two tasks; one using the shell module to run the remote command
of your choice (tail, grep, whatever) and register the output to a
variable, then a second task using the mail module to send it to recipients.

On Sat, Sep 15, 2018, 4:30 AM Bilal ahmed <bilalahmedawa...@gmail.com>
wrote:

> Hi guys,
>
> I want to copy a specific line (say last one) from a file (any log file)
> and email it using Ansible playbook. Which module can I use for this?
> Thanks in advance.
>
> BR,
> Bilal AHMED
>
> --
> 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-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/04834adb-a20f-4454-9ac0-1f08809ae92b%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/04834adb-a20f-4454-9ac0-1f08809ae92b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAFbiokf%2B%3DCseNh0yFAiOiUu6Tezb%3Dq8S6hQHELsO_Hs%2BbnKLfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to