# lvg/jinja issue

**URL:** <https://forum.ansible.com/t/lvg-jinja-issue/22055>\
**Category:** Ansible Project\
**Created:** [July 20, 2016, 6:29am UTC](https://forum.ansible.com/t/lvg-jinja-issue/22055 "2016-07-20T06:29:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oravirt](https://avatars.discourse-cdn.com/v4/letter/o/3e96dc/32.png) [@oravirt](https://forum.ansible.com/u/oravirt)\
**Post date:** [July 20, 2016, 6:29am UTC](https://forum.ansible.com/t/lvg-jinja-issue/22055/1 "2016-07-20T06:29:37Z")

</div>

Hi,

ansible --version

ansible 2.1.0.0

config file = /Users/miksan/.ansible.cfg

configured module search path = Default w/o overrides

I’ve got this [gist](https://gist.github.com/oravirt/efc23bdd4affe874a93c99c6013af3d5) where I’m attempting to create a volumegroup with multiple devices.

If I just debug the output it looks ok,

`

“msg”: "vg=vgtest pvs=/dev/sdb1,/dev/sdc1,/dev/sdd1 "

`

and if I copy-paste the debug message and run that as-is, it works as intended and the volume group is created ( I removed parts of the -vvv output).

`

ansible hostfs -m lvg -a “vg=vgtest pvs=/dev/sdb1,/dev/sdc1,/dev/sdd1 state=present” -s -i ~miksan/Applications/vagrant/hostfs/inventory -vvv

hostfs1 | SUCCESS =\> {

“changed”: true,

“invocation”: {

“module\_args”: {

“force”: false,

“pesize”: 4,

“pvs”: [

“/dev/sdb1”,

“/dev/sdc1”,

“/dev/sdd1”

],

“state”: “present”,

“vg”: “vgtest”,

“vg\_options”: “”

},

“module\_name”: “lvg”

}

}

`

But if I run the playbook, it fails at the lvg step with the following error.

`

TASK [filesystem | Create vg] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

failed: [hostfs1] (item={u’vgname’: u’vgtest’, u’disk’: [{u’device’: u’/dev/sdb’, u’pvname’: u’/dev/sdb1’}, {u’device’: u’/dev/sdc’, u’pvname’: u’/dev/sdc1’}, {u’device’: u’/dev/sdd’, u’pvname’: u’/dev/sdd1’}], u’filesystem’: [{u’mntp’: u’/vgtest’, u’fstype’: u’ext4’, u’lvname’: u’lvtest’}]}) =\> {“failed”: true, “item”: {“disk”: [{“device”: “/dev/sdb”, “pvname”: “/dev/sdb1”}, {“device”: “/dev/sdc”, “pvname”: “/dev/sdc1”}, {“device”: “/dev/sdd”, “pvname”: “/dev/sdd1”}], “filesystem”: [{“fstype”: “ext4”, “lvname”: “lvtest”, “mntp”: “/vgtest”}], “vgname”: “vgtest”}, “msg”: **“Device /dev/sdd1 not found.”}**

`

It doesn’t matter if I just use 1 device as well, the result is the same.

So, I’m not sure if the jinja-part does something to the string that I can’t see or if there is something else going on.

Any ideas?

regards  
/M

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 20, 2016, 8:12am UTC](https://forum.ansible.com/t/lvg-jinja-issue/22055/2 "2016-07-20T08:12:34Z")

</div>

> TASK [filesystem | Create vg]  
> \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> failed: [hostfs1] (item={u'vgname': u'vgtest', u'disk': [{u'device': u  
> '/dev/sdb', u'pvname': u'/dev/sdb1'}, {u'device': u'/dev/sdc', u'pvname': u  
> '/dev/sdc1'}, {u'device': u'/dev/sdd', u'pvname': u'/dev/sdd1'}], u  
> 'filesystem': [{u'mntp': u'/vgtest', u'fstype': u'ext4', u'lvname': u  
> 'lvtest'}]}) =\> {"failed": true, "item": {"disk": [{"device": "/dev/sdb",  
> "pvname": "/dev/sdb1"}, {"device": "/dev/sdc", "pvname": "/dev/sdc1"}, {  
> "device": "/dev/sdd", "pvname": "/dev/sdd1"}], "filesystem": [{"fstype":  
> "ext4", "lvname": "lvtest", "mntp": "/vgtest"}], "vgname": "vgtest"},  
> "msg": \*"Device  
> /dev/sdd1 not found."}\*

I seems to be a spaces at the end of /dev/sdd1

> It doesn't matter if I just use 1 device as well, the result is the same.
> 
> So, I'm not sure if the jinja-part does something to the string that I  
> can't see or if there is something else going on.
> 
> Any ideas?

Try removing the space at the end of host\_fs\_layout\_vgdisks under vars.

---

<div class="post-metadata">

**Author:** ![oravirt](https://avatars.discourse-cdn.com/v4/letter/o/3e96dc/32.png) [@oravirt](https://forum.ansible.com/u/oravirt)\
**Post date:** [July 20, 2016, 7:12pm UTC](https://forum.ansible.com/t/lvg-jinja-issue/22055/3 "2016-07-20T19:12:48Z")

</div>

Yep - that did the trick.

Thanks for the extra set of eyes!

/M
