On Tue, 20 Jan 2015 04:06 -0800, Mark Maas <m...@maas-martin.nl> wrote:
> Hi List,
> I’m trying to create an lvg using the lvg ansible module like so:
> - name: Maak een vg-tc
  lvg: vg=vg.osddata.raven pvs=/dev/xvdb,/dev/xvdc state=present
> 
> But I’m getting this error back:
> failed: [10.220.225.96] => {"err": "  Device /dev/xvdb /dev/xvdc not found 
> (or ignored by filtering).\n  Unable to add physical volume '/dev/xvdb 
> /dev/xvdc' to volume group 'vg.osddata.raven'.\n", "failed": true, "rc": 5}
> 
> It seems like it’s looking for a device called ‘/dev/xvdb /dev/xvdc’ instead 
> of two separate devices.

It might be because parse_pvs() function is only considering devices
that start with "/dev/dm-". 

Try changing it like this in
/usr/lib/python2.7/site-packages/ansible/ansible/modules/extras/system/lvg.py:

 def parse_pvs(module, data):
     pvs = []
-    dm_prefix = '/dev/dm-'
+    dm_prefix = '/dev/'
     for line in data.splitlines():
         parts = line.strip().split(';')
         if parts[0].startswith(dm_prefix):

I've not tested this modification. Does anyone know why it's limiting
only to dm devices?

Giovanni



-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1421780044.3584621.216375869.79725221%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to