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/8c1f9ec3-aedb-41f4-8d94-8f3e6896c1f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to