There is a module that allow me to check disk space of a folder like the command df -h /path/to/folder
?
i want to avoid to use shell or command module, i can't believe there is no module for it
Asked
Active
Viewed 1,829 times
1

Mirco
- 212
- 3
- 12
1 Answers
-1
I don't think there's any module for this. You would need to use something like the example below with the command or shell module.
- name: Check sufficient free space in directory
command: "df {{ target_dir }}"
register: space
become: true
- set_fact:
free_space_bytes: "{{ (space.stdout_lines[1] | split)[3] }}"