yes.. So one mount is at 80 percent threshold. when the playbook runs it
sends individual emails for every mount on the server that has not reached
the 80 percent.. I am trying the proper way to get the output after the
assert to send the email with only the mount that is at 80%.
FAILED! => {
"assertion": "( (disk_usage|float)/mount.size_total ) <
disk_limit|float",
"changed": false,
"evaluated_to": false,
"msg": "Disk usage 80.0% exceeds 80.0%"
On Wednesday, December 18, 2019 at 9:57:26 AM UTC-5, Vladimir Botka wrote:
>
> On Wed, 18 Dec 2019 05:18:54 -0800 (PST)
> evnflow <[email protected] <javascript:>> wrote:
>
> > Thanks that worked! Only issue is now that it is sending an email with
> the
> > status of all the mounts one at a time. Is there anyway I can limit
> email
> > to the on mount that actually hits the threshold?
> > >
> > > - block:
> > > - mail:
> > > subject: Ansible disk usage report
> > > to: [email protected] <javascript:>
> > > body: |
> > > Disk usage {{ disk_usage_ratio_s }}
> > > exceeds {{ disk_limit_ratio_s }}
> > > - meta: end_host
> > > when: ((disk_usage|float)/mount.size_total) > disk_limit|float
>
> "It is sending an email with the status of *all* the mounts" ???
>
> Why is that? Have you tested the condition?
>
> Cheers,
>
> -vlado
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0357b704-ae71-4503-9040-3893054d78ea%40googlegroups.com.