Skip to content

Instantly share code, notes, and snippets.

@metabsd
Last active April 24, 2018 13:52
Show Gist options
  • Save metabsd/8c61b6158cbc845b68735f2f527adfaf to your computer and use it in GitHub Desktop.
Save metabsd/8c61b6158cbc845b68735f2f527adfaf to your computer and use it in GitHub Desktop.
---
#- hosts: en_utilisation:installed:&linux_red_hat:!production
- hosts: en_utilisation:installed:&sldadm*
- name: test for available disk space
assert:
that:
- not {{ item.mount == '/usr' and ( item.size_total <= 5368709120 ) }}
- not {{ item.mount == '/var' and ( item.size_total <= 5368709120 ) }}
msg: "{{ item.mount }} must be more than 5G"
with_items: "{{ ansible_mounts }}"
ignore_errors: yes
register: disk_free
tags:
- debug_freespace
- name: increase lv
lvol:
vg: rootvg
lv: lv03
size: 5g
lvol:
vg: rootvg
lv: lv02
size: 5g
when: disk_free|failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment