New stuffs again
This commit is contained in:
34
syslog_size_used.yml
Normal file
34
syslog_size_used.yml
Normal file
@ -0,0 +1,34 @@
|
||||
---
|
||||
- name: Syslog - Log Size Used
|
||||
hosts: bigboot
|
||||
become: false
|
||||
gather_facts: true
|
||||
|
||||
tasks:
|
||||
- name: Get filesystem info
|
||||
ansible.builtin.set_fact:
|
||||
boot_mount: "{{ ansible_mounts | selectattr('mount', 'equalto', '/boot') | first | default() }}"
|
||||
root_mount: "{{ ansible_mounts | selectattr('mount', 'equalto', '/') | first | default() }}"
|
||||
home_mount: "{{ ansible_mounts | selectattr('mount', 'equalto', '/home') | first | default() }}"
|
||||
|
||||
- name: Debug boot_mount
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ boot_mount }}"
|
||||
|
||||
- name: Show size used -- /boot
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ (boot_mount['block_used'] * boot_mount['block_size']) | human_readable }}"
|
||||
when:
|
||||
- boot_mount['block_used'] is defined
|
||||
|
||||
- name: Show size used -- /
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ (root_mount['block_used'] * root_mount['block_size']) | human_readable }}"
|
||||
when:
|
||||
- root_mount | length > 0
|
||||
|
||||
- name: Show size used -- /home
|
||||
ansible.builtin.debug:
|
||||
msg: "{{ (home_mount['block_used'] * home_mount['block_size']) | human_readable }}"
|
||||
when:
|
||||
- home_mount | length > 0
|
Reference in New Issue
Block a user