You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
639 B
21 lines
639 B
---
|
|
- name: check disk space
|
|
# hosts: "{{ hosts }}"
|
|
hosts: all
|
|
tasks:
|
|
- name: get disk usage
|
|
command: df -h
|
|
register: disk_usage
|
|
- name: check disk space available
|
|
shell: df -h / | awk 'NR==2 {print $5}'
|
|
register: disk_usage
|
|
# - name: send discord message when disk space is over 80%
|
|
# uri:
|
|
# url: "your-webhook"
|
|
# method: POST
|
|
# body_format: json
|
|
# body: '{"content": "Disk space on {{ inventory_hostname }} is above 80%!"}'
|
|
# headers:
|
|
# Content-Type: application/json
|
|
# status_code: 204
|
|
# when: disk_usage.stdout[:-1]|int > 80
|