Thanks Kai, that worked.
Bruno
On Sunday, May 19, 2019 at 2:33:31 PM UTC+1, Bruno Cochofel wrote:
>
> Hi,
>
> I'm trying to check if all the VGs on linux servers have less than 20%
> using the following:
>
> ---
> - hosts: all
> become: True
> tasks:
> - name: Lists VGs free percentage
> debug: msg="VG {{ item.key }} has {{ (item.value.free_g|float * 100
> / item.value.size_g|float)|round }}% free)"
> with_dict: "{{ ansible_lvm.vgs }}"
> - name: Check if free percentage is greater than 20
> assert:
> that:
> - vg < 20
> msg: VG space is less than 20%
> vars:
> vg: "{{ (item.value.free_g|float * 100 /
> item.value.size_g|float)|round }}"
> with_dict: "{{ ansible_lvm.vgs }}"
>
> but without ant good.
>
> The first task works great but the assert doesn't.
>
> What am I doing wrong?
>
> Thanks,
> Bruno
>
--
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/b1c8d51f-43c7-45b8-9d72-ffb304dde9eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.