# ios\_facts module, add bytes total and bytes free

**URL:** <https://forum.ansible.com/t/ios-facts-module-add-bytes-total-and-bytes-free/29599>\
**Category:** Ansible Developer\
**Created:** [February 1, 2019, 9:52pm UTC](https://forum.ansible.com/t/ios-facts-module-add-bytes-total-and-bytes-free/29599 "2019-02-01T21:52:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Koch](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@Brian\_Koch](https://forum.ansible.com/u/Brian_Koch)\
**Post date:** [February 1, 2019, 9:52pm UTC](https://forum.ansible.com/t/ios-facts-module-add-bytes-total-and-bytes-free/29599/1 "2019-02-01T21:52:40Z")

</div>

I’m not much of a python developer, but i’m using ansible now for upgrading IOS devices.

One thing that would be helpful would if ios\_facts could also gather the flash memory total and free bytes:

EX:

Directory of flash:/

2 -rwx 916 Jan 29 2019 11:56:49 -06:00 vlan.dat  
3 -rwx 26590208 Dec 18 2018 09:28:36 -06:00 c2960x-universalk9-mz.152-6.E2.bin  
4 -rwx 14236 Jan 29 2019 17:50:43 -06:00 private-config.text  
5 -rwx 21287936 Jan 16 2019 16:10:33 -06:00 c2960x-universalk9-mz.152-2.E8.bin  
9 -rwx 8216 Jan 29 2019 11:56:55 -06:00 multiple-fs  
6 -rwx 29835 Jan 29 2019 09:51:58 -06:00 ansible\_backup\_running.cfg  
8 -rwx 23655 Jan 29 2019 17:50:43 -06:00 config.text

122185728 bytes total (73838592 bytes free) \<=============

Gathering these numbers would be helpful to help determine if there’s enough free flash memory before attempting to copy the new file into flash.

---

<div class="post-metadata">

**Author:** ![Brian\_Koch](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@Brian\_Koch](https://forum.ansible.com/u/Brian_Koch)\
**Post date:** [February 4, 2019, 6:24pm UTC](https://forum.ansible.com/t/ios-facts-module-add-bytes-total-and-bytes-free/29599/2 "2019-02-04T18:24:45Z")

</div>

Ok, I think I got it.

dir from switch:

pdctestisesw7#dir  
Directory of flash:/

2 -rwx 916 Jan 29 2019 11:56:49 -06:00 vlan.dat  
3 -rwx 26590208 Dec 18 2018 09:28:36 -06:00 c2960x-universalk9-mz.152-6.E2.bin  
4 -rwx 14236 Jan 29 2019 17:50:43 -06:00 private-config.text  
5 -rwx 21287936 Jan 16 2019 16:10:33 -06:00 c2960x-universalk9-mz.152-2.E8.bin  
9 -rwx 8216 Jan 29 2019 11:56:55 -06:00 multiple-fs  
6 -rwx 29835 Jan 29 2019 09:51:58 -06:00 ansible\_backup\_running.cfg  
8 -rwx 23655 Jan 29 2019 17:50:43 -06:00 config.text

122185728 bytes total (73838592 bytes free)  
pdctestisesw7#

I’m able to get these values now:

ansible\_net\_bytes\_free: ‘73838592’  
ansible\_net\_bytes\_total:

- ‘122185728’

How do I submit this to Ansible for approval?

---

<div class="post-metadata">

**Author:** ![psprygad](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@psprygad](https://forum.ansible.com/u/psprygad)\
**Post date:** [February 5, 2019, 12:01pm UTC](https://forum.ansible.com/t/ios-facts-module-add-bytes-total-and-bytes-free/29599/3 "2019-02-05T12:01:34Z")

</div>

Please open an issue here [https://github.com/ansible/ansible/issues](https://github.com/ansible/ansible/issues) to get this added to the current ios\_facts module
