Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To gather information on filesystem usage in gigabytes using the fact module in Ansible, you can use the following playbook:

- name: Gather disk usage facts
  hosts: your_host
  become: true
  gather_facts: true

  tasks:
    - name: Display disk usage
      debug:
        var: ansible_mounts

This playbook uses the ansible_mounts variable in the debug module to display the mounts on the system along with their usage and capacity in gigabytes.