# Ansible - create LVM

**URL:** <https://forum.ansible.com/t/ansible-create-lvm/26668>\
**Category:** Ansible Project\
**Created:** [February 5, 2018, 8:04pm UTC](https://forum.ansible.com/t/ansible-create-lvm/26668 "2018-02-05T20:04:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tasiorek27](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tasiorek27](https://forum.ansible.com/u/tasiorek27)\
**Post date:** [February 5, 2018, 8:04pm UTC](https://forum.ansible.com/t/ansible-create-lvm/26668/1 "2018-02-05T20:04:56Z")

</div>

Hello,  
I’m pretty new in ansible, so excuse me for this (stupid?) question, but it bothers me.

I’m trying to set up LVM on the remote host with ansible.

Here is my role:

`

---

<div class="post-metadata">

**Author:** ![Henning\_Rohde](https://avatars.discourse-cdn.com/v4/letter/h/3be4f8/32.png) [@Henning\_Rohde](https://forum.ansible.com/u/Henning_Rohde)\
**Post date:** [February 5, 2018, 9:07pm UTC](https://forum.ansible.com/t/ansible-create-lvm/26668/2 "2018-02-05T21:07:06Z")

</div>

As the output of some shell-command is not per se delimited to one single value, registering it creates a list.

Thus, using “{{ some\_list }}” get’s you square-brackets around the list of values - although in your case, it’s a list with just one single value.

Besides omitting the parameter, you could for instance join the list to a string: “{{ drive\_for\_lvm | join ‘’ }}”, see [https://docs.ansible.com/ansible/playbooks\_filters.html#id7](https://docs.ansible.com/ansible/playbooks_filters.html#id7)  
… or you could limit the list to its first element, either with “{{ drive\_for\_lvm[0] }}” or “{{ drive\_for\_lvm | first }}”, see again the filters or [https://docs.ansible.com/ansible/playbooks\_variables.html#accessing-complex-variable-data](https://docs.ansible.com/ansible/playbooks_variables.html#accessing-complex-variable-data)

---

<div class="post-metadata">

**Author:** ![tasiorek27](https://avatars.discourse-cdn.com/v4/letter/t/3e96dc/32.png) [@tasiorek27](https://forum.ansible.com/u/tasiorek27)\
**Post date:** [February 6, 2018, 7:11am UTC](https://forum.ansible.com/t/ansible-create-lvm/26668/3 "2018-02-06T07:11:32Z")

</div>

Thank you so much for exhaustive explanation.

Best regards,  
Michal
