9 lines
583 B
YAML
9 lines
583 B
YAML
- name: Run disk space command
|
|
ansible.builtin.shell: "df --output=used,avail / | awk 'NR==2 {used=$1; available=$2; total=used+available; percentage=used*100/total; if (percentage < {{ disk_space_percent_max }} ) printf \"true\"; else printf \"false\"}'"
|
|
# System uses the disk_space_percent_max variable to determine condition this check is getting. Over the amount defined in the var causes the check to fail!
|
|
register: disk_space_output
|
|
|
|
- name: "**DEBUG**: Server disk Utilization condition"
|
|
ansible.builtin.debug:
|
|
var: disk_space_output.stdout
|
|
when: debug | bool |