sonu_2311

Mission Specialist
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2022
09:02 PM
- 1,779 Views
Disk usage playbook
Hi all,
Can anyone guide me the playbook that display the disk usage. in that it display the folders/directories with maximum usage and also get the message...
and one more thing for the logrotate playbook also.
Thanks.
1 Reply
lp3

Cadet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2022
11:47 PM
- 1,595 Views
To display disk usage you can grab the disk usage details using ansible_facts.mounts and a jinja2 conditional like this: "Drive is mounted at {{ item.mount }} {% if item.block_used/item.block_total * 100 > 80 -%} You'll notice at the end of the conditional a bit of simple math does the comparison for whether the drive is over 80% full.
Join the discussion
You must log in to join this conversation.