'Get available space on ALL devices on server
tasks:
- name: Disk usage from device
shell: df -h /dev/(device path) --output\=pcent | tail -1 && df -h /dev/(device path) --output\=pcent | tail -1
register: devicespace
- debug:
msg: "{{ devicespace.stdout_lines }}"
Currently, I have to hardcode each device path on the server. This specific server I am testing on has two devices How can I alter this script so that it can pull the available space on all of the devices on the server. I'v tried /dev/* but that doesn't seem to work. The end goal is to pull available space on all the devices on the server and send an email if the available space is less that 10%.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
