# Block is working as expected but

**URL:** <https://forum.ansible.com/t/block-is-working-as-expected-but/34557>\
**Category:** Ansible Project\
**Created:** [February 2, 2021, 9:27pm UTC](https://forum.ansible.com/t/block-is-working-as-expected-but/34557 "2021-02-02T21:27:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aris\_Aguirre](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Aris\_Aguirre](https://forum.ansible.com/u/Aris_Aguirre)\
**Post date:** [February 2, 2021, 9:27pm UTC](https://forum.ansible.com/t/block-is-working-as-expected-but/34557/1 "2021-02-02T21:27:20Z")

</div>

Instead of throwing FATAL errors out there, can we do something like? It will say “Volume group vgaris does not exist” if the VG doesnt exist,  
and if it is like creating the 3g instead of 7G, it will say, “insufficient space, will create the 3G”

My playbook:

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 2, 2021, 10:49pm UTC](https://forum.ansible.com/t/block-is-working-as-expected-but/34557/2 "2021-02-02T22:49:52Z")

</div>

Although the docs on the size parameter don’t mention a default behavior, they do mention accepting a percentage of VG/PVS/FREE: [https://docs.ansible.com/ansible/latest/collections/community/general/lvol\_module.html#parameter-size](https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#parameter-size).  
There is an example about it as well with “100%FREE”:  
[https://docs.ansible.com/ansible/latest/collections/community/general/lvol\_module.html#examples](https://docs.ansible.com/ansible/latest/collections/community/general/lvol_module.html#examples)

This is what you are looking for (I think) - no need for trial and error.

---

<div class="post-metadata">

**Author:** ![Aris\_Aguirre](https://avatars.discourse-cdn.com/v4/letter/a/d6d6ee/32.png) [@Aris\_Aguirre](https://forum.ansible.com/u/Aris_Aguirre)\
**Post date:** [February 3, 2021, 2:44am UTC](https://forum.ansible.com/t/block-is-working-as-expected-but/34557/3 "2021-02-03T02:44:19Z")

</div>

Instead of failed for the server that doesnt have VG, it will show a message “no vg”, instead of showing fatal error. is there a way to replace the fatal errors with debug message?

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [February 3, 2021, 6:29am UTC](https://forum.ansible.com/t/block-is-working-as-expected-but/34557/4 "2021-02-03T06:29:11Z")

</div>

You should rewrite your playbook to test for the existing of such a vg, and only add an lv if the upper vg exists.
