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
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
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.
Thanks a lot dear.. I didn't knew about Shell module and had done the
task before your reply using a bash script. But its more simple with
Shell module which you introduced to me. Thanks again.