tripleo-ansible/playbooks/roles/pre_flight_disk_check
Stephanie Miller 4f22f0b5c4 Disk space pre-flight check using roles
This is an initial commit towards doing a pre-flight check for disk
space using roles in Ansible. Currently the check is pretty simple
but we could make it more complex.

Change-Id: I16182e5a42b8d65d8da9291df265480cc7e57c54
2014-11-19 16:46:37 -05:00
..
defaults Disk space pre-flight check using roles 2014-11-19 16:46:37 -05:00
tasks Disk space pre-flight check using roles 2014-11-19 16:46:37 -05:00
README.rst Disk space pre-flight check using roles 2014-11-19 16:46:37 -05:00

README.rst

Pre-flight disk check

This role can be used to check for sufficient free disk space on hosts, and will fail if there is not enough space. The amount of space may be specified as a fixed amount (in bytes) using the fail_size variable, or as a percentage of the total, using the fail_percent variable. Additionally, mounted filesystems can be excluded by mount name, if specified, in exclude_mounts.

To use the role, either include as usual (to use the default values specified in defaults/main.yml:

- hosts: hostgroup
  roles:
    - preflight_disk_check

Or specify your own values when you add the role, as follows:

- hosts: hostgroup
  roles:
    - { role: preflight_disk_check, fail_percent: 10,
  exclude_mounts: [ "/mnt" ], when: instance_status == "ACTIVE"
  }

This will allow you to easily set different parameters for different types of hosts in your playbook. Note that only one of fail_percent or fail_size will be used.