# Ansible playbook to check disk space is failing

**URL:** <https://forum.ansible.com/t/ansible-playbook-to-check-disk-space-is-failing/29187>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [December 4, 2018, 9:39am UTC](https://forum.ansible.com/t/ansible-playbook-to-check-disk-space-is-failing/29187 "2018-12-04T09:39:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![powcarz](https://avatars.discourse-cdn.com/v4/letter/p/3be4f8/32.png) [@powcarz](https://forum.ansible.com/u/powcarz)\
**Post date:** [December 4, 2018, 9:39am UTC](https://forum.ansible.com/t/ansible-playbook-to-check-disk-space-is-failing/29187/1 "2018-12-04T09:39:12Z")

</div>

Hi

You are declaring ansible\_mounts as a list of strings. It literally is:  
ansible\_mounts: ['xyz', 'abc']. Ansible is complaining, that the string  
'xyz' does not have a 'mount' property. You are obviously missing a step,  
where you actually check the available space 🙂

Piotr

---

<div class="post-metadata">

**Author:** ![anushakeshipeddy4](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anushakeshipeddy4](https://forum.ansible.com/u/anushakeshipeddy4)\
**Post date:** [December 4, 2018, 11:55am UTC](https://forum.ansible.com/t/ansible-playbook-to-check-disk-space-is-failing/29187/2 "2018-12-04T11:55:57Z")

</div>

Hi Piotr,

Thank you for your quick response. I am trying to check if the available disk space is greater than 30% and declared mounts as variables but still it is failing. COuld you please help.

Playbook.yml

---

<div class="post-metadata">

**Author:** ![powcarz](https://avatars.discourse-cdn.com/v4/letter/p/3be4f8/32.png) [@powcarz](https://forum.ansible.com/u/powcarz)\
**Post date:** [December 4, 2018, 12:49pm UTC](https://forum.ansible.com/t/ansible-playbook-to-check-disk-space-is-failing/29187/3 "2018-12-04T12:49:13Z")

</div>

Hi

vars\_files:

- /etc/ansible/xyz/pre-deploy/vars/main.yml  
you are overwriting the ansible\_mounts fact - you loose the information on mounts. Remove the above as well.

Last one  
when: item.mount == mountname
