--- - name: Check disk space hosts: all tasks: - name: Check free disk space shell: df / --output\=avail | tail -1 register: free - name: free-space debug: msg: Available space = "{{ free.stdout|int / 1000000 }}" - fail: msg: / is nearly full when: free.stdout|int is lt 3000000