# Need assistance to write script to find free space in all member switches (not just master switch)

**URL:** <https://forum.ansible.com/t/need-assistance-to-write-script-to-find-free-space-in-all-member-switches-not-just-master-switch/34769>\
**Category:** Ansible Project\
**Created:** [March 11, 2021, 9:47pm UTC](https://forum.ansible.com/t/need-assistance-to-write-script-to-find-free-space-in-all-member-switches-not-just-master-switch/34769 "2021-03-11T21:47:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_S](https://avatars.discourse-cdn.com/v4/letter/v/90db22/32.png) [@Vikram\_S](https://forum.ansible.com/u/Vikram_S)\
**Post date:** [March 11, 2021, 9:47pm UTC](https://forum.ansible.com/t/need-assistance-to-write-script-to-find-free-space-in-all-member-switches-not-just-master-switch/34769/1 "2021-03-11T21:47:45Z")

</div>

Problem: In a stacked switch, ‘ansible\_net\_filesystems\_info’ of ios\_facts module only shows total and free space of master switch. It doesn’t show space of member switch. But I need to write a script that will check for certain amount of free space in EVERY member switch before copying ios image.

A workaround idea i have is to execute below command and make ansible store free space of every member switch in a custom variable. Then is it possible to somehow tell ansible to check if the value in variable (free space value listed below) should be higher than 50 MB before copying image?

Or do you have any other suggestion?

**sh flash2: | i bytes free**

122185728 bytes total ( **9308672 bytes free** )

sh flash3: | i bytes free

122185728 bytes total (9304874 bytes free)

Thanks,

Vikram
