initial commit
This commit is contained in:
9
roles/system/tasks/check-disk-utilization.yaml
Normal file
9
roles/system/tasks/check-disk-utilization.yaml
Normal file
@@ -0,0 +1,9 @@
|
||||
- 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
|
||||
Reference in New Issue
Block a user