@Kia Hi,
As suggested I tried
item.size_total instead of item.size_available
"{{ ansible_host }}_{{ item.mount }}: {{ (100 * ((item.size_total -
item.size_available) / item.size_total)) | round(1, 'common') }}"
but it still gives me 22.2 % value instead of 19%
Can you please let me know what's wrong and why the difference?
On Wednesday, March 25, 2020 at 10:10:24 PM UTC+5:30, Kai Stian Olstad
wrote:
>
> On Wed, Mar 25, 2020 at 07:15:51AM -0700, Shifa Shaikh wrote:
> >
> > "{{ ansible_host }}_{{ item.mount }}: {{ (100 * ((item.size_total -
> item.size_available) / item.size_available)) | round(1, 'common') }}"
>
> That is not how you calculate percentage, you need to divide on
> item.size_total
> and not item.size_available.
>
> --
> Kai Stian Olstad
>
--
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/529bd7a9-69b6-4bea-a247-c0f1e9d918c9%40googlegroups.com.