I think you're overthinking it. If you need a script to regularly get disk 
utilization ansible is overkill at best. You could use pssh to accomplish 
the same thing. The email part of this is a separate beast altogether. 

```
ansible all -i inventory/your-machines -a "df -h" > output.txt
mailx -a output.txt -s "Disk Report" [email protected]
```
If you really wanted to waste your time you could include mailx in a 
playbook as a local_action.


On Friday, October 20, 2017 at 12:19:09 AM UTC-4, Отель Элеон wrote:
>
> Hello guys i have a really little experience working with ansible, but 
> today my boss told me that i should write ansible playbook for checking 
> disk space in the production machines
> we have a 15 machines and i want to enter each of them, then execute the 
> 'df -h' command, then send output to the email.
> can you give me a template of this playook? like this
> host <ip address>
> command <df -h>
> SendToEmail <emails...>
> thank you and have a nice day!
>

-- 
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/0bfaae98-a0b9-42bb-ae60-b466fb211b0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to